/* ==========================================================================
   NayanTrack — Design System
   Athletic performance aesthetic: bold, high-contrast, energetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Base surfaces — near-black with cool undertone */
  --bg-0: #07080a;
  --bg-1: #0d0f13;
  --bg-2: #14171d;
  --bg-3: #1c2029;
  --bg-4: #262b36;

  /* Text */
  --fg-0: #f4f5f7;
  --fg-1: #c9ccd4;
  --fg-2: #8a8f9c;
  --fg-3: #5a5f6b;
  --fg-4: #3a3e48;

  /* Accents */
  --accent: oklch(0.92 0.19 115);        /* electric lime — the hero color */
  --accent-dim: oklch(0.92 0.19 115 / 0.15);
  --cyan: oklch(0.82 0.14 210);          /* gaze data, live signals */
  --cyan-dim: oklch(0.82 0.14 210 / 0.15);
  --saffron: oklch(0.78 0.18 60);        /* SAI nod, use sparingly */
  --red: oklch(0.68 0.22 25);            /* alerts */
  --green: oklch(0.78 0.16 145);         /* success */
  --purple: oklch(0.72 0.16 300);        /* cognitive load */

  /* Structure */
  --line: #1f232c;
  --line-strong: #2b3040;
  --radius: 2px;
  --radius-md: 4px;

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html, body {
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-display);
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Utility text ---------- */

.mono { font-family: var(--font-mono); font-feature-settings: "zero"; }
.uc { text-transform: uppercase; letter-spacing: 0.12em; }
.tick { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-2); }
.tick-strong { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-0); }

/* Numeric display */
.num-xl { font-family: var(--font-display); font-weight: 500; font-size: 72px; line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.num-lg { font-family: var(--font-display); font-weight: 500; font-size: 48px; line-height: 0.9; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.num-md { font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1;   letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.num-sm { font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1;   letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.brand-mark::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.brand-sub { font-family: var(--font-mono); font-size: 9px; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.18em; margin-top: 6px; }
.brand-devanagari { font-size: 10px; color: var(--fg-2); margin-left: 4px; }

.nav-section {
  padding: 16px 20px 8px;
}
.nav-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-3);
  margin-bottom: 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 13px;
  color: var(--fg-1);
  border-left: 2px solid transparent;
  transition: all 0.12s;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--bg-2); color: var(--fg-0); }
.nav-item.active {
  background: var(--bg-2);
  color: var(--accent);
  border-left-color: var(--accent);
}
.nav-item-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-4);
  flex-shrink: 0;
}
.nav-item.active .nav-item-dot { background: var(--accent); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-0);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 20px; }
.topbar-crumb { font-family: var(--font-mono); font-size: 11px; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.14em; }
.topbar-crumb span.active { color: var(--fg-0); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.status-pill.live { border-color: var(--cyan); color: var(--cyan); }
.status-pill.rec { border-color: var(--red); color: var(--red); }
.status-pill.ok { border-color: var(--green); color: var(--green); }
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

/* ---------- Panels ---------- */

.main { padding: 0; background: var(--bg-0); min-width: 0; }
.page { padding: 32px; }

.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-1); }
.panel-body { padding: 18px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--fg-0);
  transition: all 0.12s;
}
.btn:hover { background: var(--bg-2); border-color: var(--fg-3); }
.btn.primary { background: var(--accent); color: #0a0b0d; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: oklch(0.96 0.19 115); }
.btn.ghost { border-color: transparent; }
.btn.danger { border-color: var(--red); color: var(--red); }

/* ---------- Cards & KPIs ---------- */

.kpi {
  padding: 20px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}
.kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-2);
  margin-bottom: 12px;
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-unit { font-family: var(--font-mono); font-size: 14px; color: var(--fg-2); margin-left: 4px; font-weight: 400; }
.kpi-delta {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 8px;
}
.kpi-delta.up { color: var(--accent); }
.kpi-delta.down { color: var(--red); }

/* ---------- Tables ---------- */

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-2);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.tbl td {
  padding: 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-1);
}
.tbl tr:hover td { background: var(--bg-2); }
.tbl .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--fg-0); }

/* ---------- Divider & meta ---------- */

.divider { height: 1px; background: var(--line); margin: 0; }
.vdivider { width: 1px; background: var(--line); align-self: stretch; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---------- Bars / meters ---------- */

.bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}
.bar-fill { height: 100%; background: var(--accent); }
.bar-fill.cyan { background: var(--cyan); }
.bar-fill.red { background: var(--red); }
.bar-fill.saffron { background: var(--saffron); }

/* ---------- Chip / tag ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--fg-1);
}
.chip.accent { border-color: var(--accent); color: var(--accent); }
.chip.cyan { border-color: var(--cyan); color: var(--cyan); }
.chip.red { border-color: var(--red); color: var(--red); }
.chip.green { border-color: var(--green); color: var(--green); }
.chip.saffron { border-color: var(--saffron); color: var(--saffron); }
.chip.filled { background: var(--accent); color: #0a0b0d; border-color: var(--accent); font-weight: 600; }

/* ---------- Avatar ---------- */

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--fg-0);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.avatar.lg { width: 48px; height: 48px; font-size: 15px; }
.avatar.xl { width: 72px; height: 72px; font-size: 22px; }

/* ---------- Section header ---------- */

.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.page-title {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-2);
  margin-bottom: 10px;
}

/* ---------- Section title (in-page) ---------- */

.section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

/* ---------- Focus ---------- */

button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Home hub specifics ---------- */

.hub {
  min-height: 100vh;
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
}
.hub-header { display: flex; justify-content: space-between; align-items: flex-start; }
.hub-brand { display: flex; align-items: center; gap: 14px; }
.hub-brand-mark {
  width: 44px; height: 44px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
}
.hub-brand-mark::before {
  content: '';
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
}
.hub-brand-title { font-size: 22px; font-weight: 700; letter-spacing: 0.01em; }
.hub-brand-sub { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--fg-2); margin-top: 3px; }

.hero {
  margin-top: 80px;
  margin-bottom: 60px;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(56px, 8vw, 120px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.92;
  max-width: 1100px;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub {
  margin-top: 32px;
  max-width: 640px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--fg-1);
}
.hero-stats {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  max-width: 900px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.hero-stat-num { font-size: 40px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-stat-num em { font-style: normal; color: var(--accent); }
.hero-stat-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-2); margin-top: 8px; }

.persona-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 80px;
}
.persona-card {
  background: var(--bg-0);
  padding: 28px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 240px;
  position: relative;
}
.persona-card:hover { background: var(--bg-1); }
.persona-card:hover .persona-arrow { color: var(--accent); transform: translate(4px, -4px); }
.persona-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.14em;
}
.persona-title {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.persona-desc {
  font-size: 12px;
  color: var(--fg-2);
  line-height: 1.5;
  margin-top: -12px;
}
.persona-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.persona-arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--fg-3);
  transition: all 0.18s;
}
