/* Jobsindexed — a calm, market-terminal look that stays legible for non-experts. */

:root {
  --bg:        #0b0f17;
  --bg-2:      #111725;
  --panel:     #141c2b;
  --panel-2:   #182234;
  --border:    #223046;
  --text:      #e8edf5;
  --text-dim:  #93a1b8;
  --text-mute: #64748b;
  --accent:    #5b8cff;
  --up:        #26c281;
  --up-soft:   rgba(38, 194, 129, 0.15);
  --down:      #f0596b;
  --down-soft: rgba(240, 89, 107, 0.15);
  --neutral:   #8ba0bd;
  --radius:    14px;
  --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:      "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, #16213a 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.7);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; gap: 18px; padding: 16px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  color: var(--up); font-size: 22px; line-height: 1;
  filter: drop-shadow(0 0 10px rgba(38,194,129,0.5));
}
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand-dot {
  font-size: 12px; color: var(--text-mute); font-weight: 500;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px;
}
.tagline { margin: 0; color: var(--text-dim); font-size: 14px; }

/* ---------- overall layout: chart is the hero, sidebar to the right ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
  margin-top: 24px;
}
.chart-column { min-width: 0; }
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 84px;
}

/* ---------- controls (stacked in the sidebar) ---------- */
.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.control { display: flex; flex-direction: column; gap: 6px; }
.control label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mute); font-weight: 600; }
select {
  appearance: none;
  background: var(--panel-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%2393a1b8' stroke-width='1.6'/></svg>") no-repeat right 14px center;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 38px 11px 13px;
  font-size: 15px;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:hover { border-color: #2f4463; }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,140,255,0.2); }
.controls-hint { margin: 0; color: var(--text-mute); font-size: 12.5px; }

/* ---------- view heading ---------- */
.view-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.view-head h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; }
.view-subtitle { margin: 0; color: var(--text-dim); font-size: 18px; }
.sample-flag {
  margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: #d9b24a; background: rgba(217,178,74,0.12); border: 1px solid rgba(217,178,74,0.3);
  padding: 4px 9px; border-radius: 999px; cursor: help;
}

/* ---------- compact stat cards (sidebar) ---------- */
.cards { display: flex; flex-direction: column; gap: 12px; }
.cardc {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  display: flex; flex-direction: column; gap: 5px;
}
.cardc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cardc-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.cardc-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.cardc-value .unit { font-size: 14px; color: var(--text-dim); font-weight: 500; }
.cardc-sub { font-size: 12px; color: var(--text-dim); }
.cardc-sub2 { font-size: 12px; color: var(--text-mute); }
.help {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text-dim); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1;
}
.help:hover { color: var(--text); border-color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 13px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.badge em { font-style: normal; font-weight: 500; opacity: 0.8; }
.badge.up { color: var(--up); background: var(--up-soft); }
.badge.down { color: var(--down); background: var(--down-soft); }
.badge.neutral { color: var(--neutral); background: rgba(139,160,189,0.12); }

/* ---------- chart ---------- */
.chart-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 8px; }
.chart-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.legend { display: flex; gap: 16px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); }
.swatch { width: 18px; height: 0; border-top: 3px solid; display: inline-block; border-radius: 2px; }
.swatch.primary { border-color: var(--up); }
.swatch.yearago { border-top-style: dashed; border-color: var(--text-mute); opacity: 0.8; }

.chart-wrap { position: relative; width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }
.grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 5; opacity: 0.6; }
.axis-label { fill: var(--text-mute); font-size: 11px; font-family: var(--font); }
.axis-label.y { text-anchor: end; }
.axis-label.x { text-anchor: middle; }
.line-primary { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.line-yearago { fill: none; stroke: var(--text-mute); stroke-width: 1.6; stroke-dasharray: 5 5; opacity: 0.5; }
.end-dot { stroke: var(--panel); stroke-width: 2; }
.crosshair { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3 3; transition: opacity 0.1s; }
.hover-dot { fill: var(--panel); stroke-width: 2.5; }

.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: #0a0e16; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; box-shadow: var(--shadow); transition: opacity 0.1s; min-width: 120px;
}
.tip-month { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.tip-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; }
.tip-val span { font-size: 12px; font-weight: 500; color: var(--text-dim); }
.tip-year { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.tip-year b { color: var(--text); }

.chart-note { margin: 14px 0 0; font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.chart-note b { color: var(--text); }

/* ---------- read panel ---------- */
.read-panel {
  margin-top: 18px; display: flex; gap: 16px;
  background: var(--panel); border: 1px solid var(--border);
  border-left: 4px solid var(--neutral);
  border-radius: var(--radius); padding: 18px 20px;
}
.read-panel.tone-good { border-left-color: var(--up); }
.read-panel.tone-soft { border-left-color: var(--down); }
.read-panel.tone-mixed { border-left-color: #d9b24a; }
.read-panel.tone-neutral { border-left-color: var(--neutral); }
.read-icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: var(--panel-2); color: var(--text-dim);
}
.tone-good .read-icon { color: var(--up); background: var(--up-soft); }
.tone-soft .read-icon { color: var(--down); background: var(--down-soft); }
.tone-mixed .read-icon { color: #d9b24a; background: rgba(217,178,74,0.14); }
.read-body h3 { margin: 2px 0 6px; font-size: 17px; }
.read-body p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.read-foot { margin-top: 10px !important; font-size: 12.5px !important; color: var(--text-mute) !important; }
.read-foot b { color: var(--text-dim); }

/* ---------- popover ---------- */
.popover {
  position: absolute; z-index: 50; max-width: 280px;
  background: #0a0e16; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: 13px; color: var(--text-dim); line-height: 1.5;
  box-shadow: var(--shadow);
}

/* ---------- footer ---------- */
.site-footer { margin: 30px 0 50px; padding-top: 18px; border-top: 1px solid var(--border); }
.site-footer p { margin: 0; font-size: 12.5px; color: var(--text-mute); line-height: 1.55; }
.site-footer b { color: var(--text-dim); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* Collapse to a single column. Chart column comes first in the DOM, so the
     graph stays the first thing you see; selection + stats follow beneath it. */
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .sidebar { position: static; top: auto; }
  /* Lay the compact stats out as a responsive row when there's width for it. */
  .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
  .view-head h1 { font-size: 24px; }
  .sample-flag { margin-left: 0; }
  .tagline { display: none; }
}
