/* ==========================================================================
   ZMG Ice Blue Modern — brand tokens + HUD primitives
   Reused verbatim from prior ZMG builds. Do not invent new brand values.
   ========================================================================== */

:root {
  /* dark mode (primary) */
  --zmg-black: #000205;
  --bg: #000205;
  --surface: #0a1018;
  --card: #0d1520;
  --card-2: #101a26;
  --hair: rgba(169, 220, 255, 0.14);
  --hair-strong: rgba(169, 220, 255, 0.26);
  --blue: #1e90ff;
  --blue-mid: #7fc4ff;
  --ice: #a9dcff;
  --text: #eef7ff;
  --muted: #8fa6bc;
  --amber: #f0a93b;
  --risk: #ff6b5c;
  --tint: rgba(30, 144, 255, 0.1);
  --tint-2: rgba(30, 144, 255, 0.055);
  --glow-sm: 0 0 12px rgba(30, 144, 255, 0.4);
  --glow: 0 0 24px rgba(30, 144, 255, 0.34), 0 0 60px rgba(30, 144, 255, 0.14);
  --glow-lg: 0 0 40px rgba(30, 144, 255, 0.38), 0 0 120px rgba(30, 144, 255, 0.18);
  --shadow: 0 18px 50px rgba(0, 2, 5, 0.7);
  --text-on-blue: #00121f;

  /* radii + spacing */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  --head: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --sidebar-w: 268px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme='light'] {
  --bg: #f4f9ff;
  --surface: #ffffff;
  --card: #ffffff;
  --card-2: #f0f7ff;
  --hair: rgba(10, 25, 45, 0.1);
  --hair-strong: rgba(10, 25, 45, 0.2);
  --blue: #1e90ff;
  --blue-mid: #2b7fd4;
  --ice: #2f7bbf;
  --text: #07131f;
  --muted: #5a7186;
  --amber: #b8760d;
  --risk: #d0402f;
  --tint: #e8f3ff;
  --tint-2: #f2f8ff;
  --glow-sm: 0 2px 8px rgba(30, 144, 255, 0.18);
  --glow: 0 6px 22px rgba(30, 144, 255, 0.2);
  --glow-lg: 0 12px 40px rgba(30, 144, 255, 0.22);
  --shadow: 0 12px 34px rgba(10, 35, 70, 0.1);
  --text-on-blue: #ffffff;
}

/* ------------------------------------------------------------------ resets */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--blue); text-decoration: none; }
::selection { background: rgba(30, 144, 255, 0.32); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* page bloom — never flat black */
body::before {
  content: '';
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(30, 144, 255, 0.16), transparent 70%),
    radial-gradient(40% 45% at 82% 8%, rgba(169, 220, 255, 0.07), transparent 72%);
}
[data-theme='light'] body::before {
  background: radial-gradient(60% 60% at 50% 0%, rgba(30, 144, 255, 0.12), transparent 72%);
}

/* --------------------------------------------------------------- typography */
h1, h2, h3, h4, .oswald {
  font-family: var(--head);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.05;
}
h1 { font-size: clamp(28px, 4.4vw, 46px); letter-spacing: -0.015em; }
h2 { font-size: clamp(20px, 2.4vw, 27px); }
h3 { font-size: 17px; letter-spacing: 0.005em; }
h4 { font-size: 14px; letter-spacing: 0.06em; font-weight: 500; }
p { margin: 0 0 0.85em; }
p:last-child { margin-bottom: 0; }

/* headline gradient treatment (from the ZMG banner) */
.gh { display: inline; }
.gh-lead {
  background: linear-gradient(178deg, #ffffff 6%, #eef7ff 38%, #a9dcff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.gh-rest {
  background: linear-gradient(178deg, #cfe9ff 4%, #7fc4ff 48%, #1e90ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.gh-wrap {
  filter: drop-shadow(0 0 18px rgba(30, 144, 255, 0.4)) drop-shadow(0 0 46px rgba(30, 144, 255, 0.2));
}
[data-theme='light'] .gh-lead {
  background: linear-gradient(178deg, #0b2740 10%, #1a5f9e 100%);
  -webkit-background-clip: text; background-clip: text;
}
[data-theme='light'] .gh-rest {
  background: linear-gradient(178deg, #2b8fe0 6%, #1e90ff 100%);
  -webkit-background-clip: text; background-clip: text;
}
[data-theme='light'] .gh-wrap { filter: drop-shadow(0 4px 14px rgba(30, 144, 255, 0.24)); }

/* eyebrow */
.eyebrow {
  font-family: var(--head);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ice);
  text-shadow: 0 0 14px rgba(169, 220, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
}
[data-theme='light'] .eyebrow { text-shadow: none; color: var(--ice); }
.eyebrow::before {
  content: '';
  width: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue));
  box-shadow: var(--glow-sm);
  flex: none;
}

.mono {
  font-family: 'SFMono-Regular', ui-monospace, 'Roboto Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; letter-spacing: 0.03em; }

/* ------------------------------------------------------------- HUD surfaces */
.card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  position: relative;
  box-shadow: var(--shadow);
}
[data-theme='light'] .card { box-shadow: 0 6px 20px rgba(10, 35, 70, 0.06); }
.card.flat { box-shadow: none; background: var(--surface); }

/* the framed HUD container from the brand banner */
.hud {
  position: relative;
  border: 1px solid rgba(30, 144, 255, 0.55);
  border-radius: var(--r-xl);
  background:
    linear-gradient(180deg, rgba(30, 144, 255, 0.07), rgba(0, 2, 5, 0) 46%),
    var(--card);
  box-shadow:
    0 0 0 1px rgba(30, 144, 255, 0.12),
    0 0 26px rgba(30, 144, 255, 0.26),
    inset 0 0 40px rgba(30, 144, 255, 0.06),
    var(--shadow);
  overflow: hidden;
}
[data-theme='light'] .hud {
  border-color: rgba(30, 144, 255, 0.4);
  box-shadow: 0 10px 34px rgba(30, 144, 255, 0.16), inset 0 0 30px rgba(30, 144, 255, 0.04);
  background: linear-gradient(180deg, #f7fbff, #ffffff 60%);
}
/* bright accent segment breaking the top border */
.hud::before {
  content: '';
  position: absolute;
  top: -1px; left: 50%; transform: translateX(-50%);
  width: min(320px, 46%); height: 2px;
  background: linear-gradient(90deg, transparent, #ffffff 30%, var(--blue) 50%, #ffffff 70%, transparent);
  box-shadow: 0 0 16px rgba(30, 144, 255, 0.9);
  z-index: 3;
}
/* halftone dot matrix fading at the panel edges */
.hud::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(120, 195, 255, 0.55) 1px, transparent 1.4px);
  background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, transparent 16%, transparent 84%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0, transparent 16%, transparent 84%, #000 100%);
  opacity: 0.5;
  z-index: 0;
}
[data-theme='light'] .hud::after { opacity: 0.4; background-image: radial-gradient(rgba(30, 144, 255, 0.4) 1px, transparent 1.4px); }
.hud > * { position: relative; z-index: 2; }

/* corner tick / chevron hash marks */
.ticks { position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0.85; }
.ticks i {
  position: absolute;
  width: 26px; height: 6px;
  background: repeating-linear-gradient(115deg, var(--blue) 0 2px, transparent 2px 5px);
  box-shadow: 0 0 10px rgba(30, 144, 255, 0.6);
}
.ticks i:nth-child(1) { top: 14px; left: 26px; }
.ticks i:nth-child(2) { top: 14px; right: 26px; }
.ticks i:nth-child(3) { bottom: 14px; left: 26px; }
.ticks i:nth-child(4) { bottom: 14px; right: 26px; }

/* light-wave divider motif */
.wave { display: block; width: 100%; height: 44px; overflow: hidden; pointer-events: none; }
.wave svg { width: 220%; height: 100%; }
.wave path { fill: none; stroke: var(--blue); filter: drop-shadow(0 0 6px rgba(30, 144, 255, 0.85)); }
.wave .w1 { stroke-width: 1.6; opacity: 0.95; animation: drift 17s linear infinite; }
.wave .w2 { stroke-width: 1; opacity: 0.55; animation: drift 24s linear infinite reverse; }
.wave .w3 { stroke-width: 0.7; opacity: 0.35; animation: drift 32s linear infinite; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* glowing hairline */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(30, 144, 255, 0.85) 22%, rgba(169, 220, 255, 0.95) 50%, rgba(30, 144, 255, 0.85) 78%, transparent);
  box-shadow: 0 0 14px rgba(30, 144, 255, 0.55);
}

/* --------------------------------------------------------------- components */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  font-family: var(--head);
  font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text);
  background: var(--card-2);
  transition: transform 0.16s var(--ease), box-shadow 0.22s var(--ease), background 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--blue); box-shadow: var(--glow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, #4facff, var(--blue));
  border-color: rgba(255, 255, 255, 0.28);
  color: #00121f;
  box-shadow: var(--glow);
  font-weight: 600;
}
[data-theme='light'] .btn-primary { color: #fff; }
.btn-primary:hover { box-shadow: var(--glow-lg); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: 11.5px; }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: var(--tint-2);
  font-size: 11.5px; letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
}
.chip strong { color: var(--text); font-weight: 500; }
.chip-blue { border-color: rgba(30, 144, 255, 0.45); background: var(--tint); color: var(--ice); }
.chip-blue strong { color: var(--ice); }
.chip-amber { border-color: rgba(240, 169, 59, 0.5); color: var(--amber); background: transparent; }
.chip-risk { border-color: rgba(255, 107, 92, 0.5); color: var(--risk); background: transparent; }
.chip-btn { cursor: pointer; transition: 0.18s var(--ease); }
.chip-btn:hover { border-color: var(--blue); color: var(--text); box-shadow: var(--glow-sm); }
.chip-src { border-style: dashed; }

.tile {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 16px 16px 14px;
  position: relative;
  overflow: hidden;
}
/* glowing blue tick mark on the top edge of every stat tile */
.tile::before {
  content: '';
  position: absolute; top: 0; left: 18px;
  width: 34px; height: 2px;
  background: var(--blue);
  box-shadow: var(--glow-sm);
}
.tile .k { font-family: var(--head); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; display: block; }
.tile .l { font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }

.warnrail { border-left: 2px solid var(--amber); padding-left: 14px; }
.riskrail { border-left: 2px solid var(--risk); padding-left: 14px; }
.bluerail { border-left: 2px solid var(--blue); padding-left: 14px; box-shadow: -6px 0 18px -8px rgba(30, 144, 255, 0.6); }

.bar { height: 6px; border-radius: 999px; background: rgba(143, 166, 188, 0.2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--blue-mid)); box-shadow: var(--glow-sm); transition: width 0.7s var(--ease); }
.bar.warn > i { background: linear-gradient(90deg, #d78a1c, var(--amber)); box-shadow: none; }
.bar.risk > i { background: linear-gradient(90deg, #d9483a, var(--risk)); box-shadow: none; }

.check {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--blue); color: #00121f;
  box-shadow: var(--glow-sm);
  font-size: 11px; font-weight: 700;
}

.grid { display: grid; gap: var(--sp-4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: var(--sp-3); align-items: center; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack > * + * { margin-top: var(--sp-4); }

/* skeletons */
.sk { border-radius: 8px; background: linear-gradient(100deg, rgba(143,166,188,0.1) 20%, rgba(169,220,255,0.2) 40%, rgba(143,166,188,0.1) 60%); background-size: 220% 100%; animation: shimmer 1.25s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -60% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
