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

:root {
  --bg: #0A0D12;
  --surface: #12161D;
  --surface-2: #1A1F27;
  --border: #232A34;
  --text: #E6EBF0;
  --text-dim: #7C8794;
  --amber: #E8A33D;
  --cyan: #4FD8E8;
  --coral: #E8664A;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --radius: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  padding-bottom: 88px; /* room for bottom nav */
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Status bar (signature element) ---------- */
.status-bar {
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  background: var(--surface);
}

.status-bar .id {
  color: var(--text);
  font-weight: 500;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  margin-right: 6px;
  box-shadow: 0 0 6px var(--amber);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------- Header ---------- */
.header {
  padding: 28px 20px 20px;
}

.header h1 {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--stat-color, var(--text-dim));
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
}

.stat-card .value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.stat-card .label {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  padding: 20px 20px 0;
  overflow-x: auto;
}

.tab-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--cyan);
}

/* ---------- Project list ---------- */
.project-list {
  padding: 14px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--row-color, var(--text-dim));
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
}

.project-row .info { flex: 1; min-width: 0; }

.project-row .title {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 3px;
}

.project-row .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
}

.project-row .arrow { color: var(--text-dim); font-family: var(--mono); }

/* ---------- Chart panel ---------- */
.chart-panel {
  margin: 16px 20px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: 240px;
}

/* ---------- Skill tags ---------- */
.tag-cloud {
  padding: 14px 20px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 9px;
  color: var(--text);
}

.tag .count {
  color: var(--cyan);
  margin-left: 5px;
  font-weight: 700;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.nav-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 10px 16px;
  border-radius: 22px;
  cursor: pointer;
}

.nav-btn.active {
  background: var(--bg);
  color: var(--amber);
}

/* ---------- View sections ---------- */
.view { display: none; }
.view.active { display: block; }

.data-panel { display: none; }
.data-panel.active { display: block; }

/* ---------- Modal ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
}

.modal-backdrop.open { display: block; }

.modal {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 82vh;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 20px;
  overflow-y: auto;
  z-index: 51;
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal h2 {
  font-family: var(--mono);
  font-size: 16px;
  margin: 0 0 16px;
}

.modal .row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.modal .row span:first-child { color: var(--text-dim); }
.modal .row span:last-child { font-family: var(--mono); }

.modal .section-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 18px 0 8px;
}

.modal ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.modal ul li { margin-bottom: 6px; }

.modal-close {
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  border: none;
  border-radius: var(--radius);
  background: var(--cyan);
  color: #0A0D12;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, 1fr); max-width: 640px; }
  .header, .stats, .tabs, .project-list, .chart-panel, .tag-cloud { max-width: 640px; margin-left: auto; margin-right: auto; }
  .modal { left: 50%; transform: translateX(-50%); width: 480px; border-radius: 14px; bottom: 40px; max-height: 80vh; }
}
