/* ============================================================
   UNTANGLED — Dashboard Theme
   Black & white base with neon (cyan / magenta / violet) lights.
   ============================================================ */

:root {
  /* Core palette */
  --bg-0: #04050a;          /* deepest black */
  --bg-1: #080a12;          /* panel base */
  --bg-2: #0e111c;          /* raised panel */
  --bg-3: #151a2b;          /* hover */
  --line: rgba(255,255,255,.08);
  --line-bright: rgba(255,255,255,.16);

  /* Text — tuned for WCAG AA on the dark glass (body ≥4.5:1).
     --muted: secondary text on glass panels (~5–9:1).
     --dim:   tertiary micro-labels, mainly on the void/sidebar (~5–7:1). */
  --white: #f6f8ff;
  --muted: #a9b2cc;
  --dim: #828daa;

  /* White LED palette (futuristic glowing white) */
  --neon-cyan: #ffffff;          /* primary LED white */
  --neon-violet: #aebed6;        /* silver / cool-white (secondary data) */
  --neon-mag:  #ff5d6c;          /* alert accent only (delete / down) */
  --neon-lime: #bdffe0;          /* faint mint (positive / online) */
  --neon-cyan-soft: rgba(255,255,255,.55);
  --neon-mag-soft:  rgba(255,255,255,.4);

  --glow-cyan: 0 0 8px rgba(255,255,255,.85), 0 0 22px rgba(255,255,255,.45);
  --glow-mag:  0 0 8px rgba(255,93,108,.55), 0 0 20px rgba(255,93,108,.3);
  --glow-led:  0 0 6px rgba(255,255,255,.9), 0 0 18px rgba(255,255,255,.5), 0 0 40px rgba(255,255,255,.2);

  --radius: 24px;
  --radius-sm: 16px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-cinema: cubic-bezier(.76,0,.24,1);
  --spring: cubic-bezier(.34,1.56,.64,1);   /* bouncy iOS spring */

  --font-display: 'Orbitron', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;   /* native controls (colour input, form fields, scrollbars) render dark */
}

/* Calm black background — a single subtle static top glow + faint static grid.
   (No animation/pulsing → no flashing behind the glass.) */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(1100px 620px at 50% -22%, rgba(255,255,255,.05), transparent 60%);
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 80%);
}

/* ---------- Typography ---------- */
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; line-height: 1.1; text-wrap: balance; }
a { color: inherit; text-decoration: none; }
.text-muted { color: var(--muted); }
.text-dim { color: var(--dim); }

.neon-text {
  color: #fff;
  text-shadow: var(--glow-cyan);
}
/* Solid LED white — emphasis comes from the Orbitron weight + a soft glow,
   not a gradient clip (gradient text is a banned decorative tell). */
.gradient-text {
  color: #fff;
  text-shadow: 0 0 18px rgba(255,255,255,.22);
}

/* ---------- Glass panels ---------- */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.panel::before {           /* top neon hairline */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan-soft), transparent);
  opacity: .7;
  pointer-events: none;    /* decorative — never block clicks/focus */
}
.panel-pad { padding: 22px 24px; }

/* ---------- Liquid-glass utility ----------
   Light-catching 1.4px gradient border via mask-composite (bright top & bottom,
   fading at the sides). Use on small standalone elements (logo, chips) — NOT on
   .panel (which has its own ::before/::after). */
.liquid-glass {
  position: relative; overflow: hidden;
  background: rgba(255,255,255,.02);
  backdrop-filter: blur(6px) saturate(1.4);
  -webkit-backdrop-filter: blur(6px) saturate(1.4);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.12);
}
.liquid-glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.4px;
  background: linear-gradient(180deg,
    rgba(255,255,255,.5) 0%, rgba(255,255,255,.16) 22%,
    rgba(255,255,255,0) 42%, rgba(255,255,255,0) 58%,
    rgba(255,255,255,.16) 78%, rgba(255,255,255,.5) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  --c: var(--neon-cyan);
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px;
  font-family: var(--font-display); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--white); cursor: pointer;
  background: rgba(255,255,255,.05);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  transition: transform .4s var(--spring), box-shadow .3s var(--ease), background .3s;
  overflow: hidden; will-change: transform;
}
.btn:hover { background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 45%, transparent); }
.btn:active { transform: scale(.96); }
.btn--mag { --c: var(--neon-mag); }
.btn--violet { --c: var(--neon-violet); }
.btn--solid {
  background: linear-gradient(120deg, var(--neon-cyan), var(--neon-violet));
  color: #04050a; border: none; font-weight: 700;
  box-shadow: 0 0 18px rgba(255,255,255,.32);
}
.btn--solid:hover { box-shadow: 0 0 30px rgba(255,255,255,.5); }
@media (pointer: coarse) { .btn { padding: 14px 22px; } }   /* ≥44px tap target on touch */
/* click ripple */
.btn .ripple {
  position: absolute; border-radius: 50%; transform: translate(-50%,-50%) scale(0);
  background: rgba(255,255,255,.45); pointer-events: none; animation: ripple .6s var(--ease) forwards;
}
@keyframes ripple { to { transform: translate(-50%,-50%) scale(8); opacity: 0; } }
/* light sweep across a button on hover — one-shot, transform-only (GPU-cheap) */
.btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 42%, rgba(255,255,255,.20) 50%, transparent 58%);
  transform: translateX(-130%);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn:hover::after { animation: btnSheen .6s var(--ease) 1; }
}
@keyframes btnSheen { from { transform: translateX(-130%); } to { transform: translateX(130%); } }

/* ---------- Pills / chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: .72rem; letter-spacing: .04em;
  border: 1px solid var(--line-bright); color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.dot--mag { background: var(--neon-mag); box-shadow: var(--glow-mag); }
.dot--lime { background: var(--neon-lime); box-shadow: 0 0 8px rgba(141,255,92,.7); }

/* ---------- Custom cursor (JS drives the transform: lerp + velocity stretch) ---------- */
@media (pointer: fine) {
  * { cursor: none !important; }
  .cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; will-change: transform; }
  .cursor-dot {
    width: 7px; height: 7px; background: #fff;
    box-shadow: var(--glow-cyan); transform: translate(-50%,-50%);
  }
  .cursor-ring {
    width: 34px; height: 34px; border: 1.5px solid var(--neon-cyan-soft);
    box-shadow: 0 0 12px rgba(255,255,255,.18);
    transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
    mix-blend-mode: screen;
  }
  /* size/scale is handled in JS via transform; hover only shifts colour + glow */
  .cursor-ring.is-hover { border-color: #fff; background: rgba(255,255,255,.10); box-shadow: 0 0 22px rgba(255,255,255,.45); }
}

/* ---------- Keyboard focus ---------- */
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255,255,255,.18);
}
/* Skip link — first tab stop, hidden until focused */
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 9999;
  background: #fff; color: #04050a;
  font-family: var(--font-display); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--glow-led);
  transform: translateY(-180%); transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; outline: none; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--neon-cyan), var(--neon-violet)); border-radius: 10px; border: 2px solid var(--bg-1); }

/* ---------- Reveal-on-load helpers ---------- */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); }

/* Page intro wipe */
#intro {
  position: fixed; inset: 0; z-index: 9000; background: var(--bg-0);
  display: grid; place-items: center; transition: clip-path 1s var(--ease-cinema), opacity .6s ease .6s;
  clip-path: inset(0 0 0 0);
}
#intro.gone { clip-path: inset(0 0 100% 0); opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
