/* ═══════════════════════════════════════════════════
   BLUEPRINT THEME — Muted Neo / Dark
   ═══════════════════════════════════════════════════ */

:root {
  --bg-deep: #0b0e13;
  --bg-base: #0e1218;
  --bg-surface: #12161e;
  --bg-elevated: #181d27;
  --border: #1e2530;
  --border-subtle: #181d27;
  --cyan: #00d4ff;
  --cyan-dim: #0088aa;
  --cyan-bright: #40e8ff;
  --blue: #1a8cff;
  --text: #b8c4d4;
  --text-dim: #555f70;
  --text-bright: #e0e6ef;
  --green: #00e89d;
  --yellow: #ffc857;
  --red: #ff4d6a;
  --orange: #ff8844;
  --mono: 'SF Mono', SFMono-Regular, 'Cascadia Code', Consolas, 'Liberation Mono', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Perspective grid — SVG tile for clean lines under perspective */
body::before {
  content: '';
  position: fixed; bottom: 0; left: -50%; right: -50%;
  height: 200vh; z-index: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 59px, #1090b870 59px, #1090b870 60px);
  background-size: 60px 100%;
  transform: perspective(400px) rotateX(45deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, transparent 85%);
}

.page { position: relative; z-index: 1; }

/* ── NAV ── */
nav {
  backdrop-filter: blur(20px);
  background: #0b0e13dd;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
nav .inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
nav .logo {
  font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text-bright);
  letter-spacing: -0.5px;
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
nav .logo .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--cyan); }
  50% { opacity: 0.4; box-shadow: 0 0 3px var(--cyan); }
}
nav .links { display: flex; gap: 24px; }
nav .links a {
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  text-decoration: none; text-transform: uppercase; letter-spacing: 0.8px;
  transition: color 0.2s;
}
nav .links a:hover { color: var(--text-bright); }
nav .links a.active { color: var(--text-bright); border-bottom: 1px solid var(--cyan); padding-bottom: 2px; }

/* ── CONTAINER ── */
.container { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }

/* ── 3D WIREFRAME CARD ── */
.card {
  background: #12161ecc;
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  border-color: #2a3040;
  box-shadow: 0 4px 24px #00000050;
  transform: translateY(-1px);
}

/* 3D wireframe effect on stat cards */
.card-3d {
  perspective: 800px;
}
.card-3d .card-face {
  background: #12161ecc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  transform: rotateX(2deg) rotateY(-2deg);
  transform-style: preserve-3d;
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.card-3d:hover .card-face {
  transform: rotateX(0deg) rotateY(0deg);
  border-color: #2a3040;
  box-shadow:
    0 6px 24px #00000040,
    3px 3px 0 0 #1a1f2833,
    6px 6px 0 0 #1a1f2822,
    9px 9px 0 0 #1a1f2811;
}
/* Wireframe edges — faint top-left highlight */
.card-3d .card-face::after {
  content: '';
  position: absolute; inset: -1px; border-radius: 12px; pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #ffffff04, transparent 40%) border-box;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: xor; -webkit-mask-composite: xor;
}

/* ── STATS ── */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-dim); margin-bottom: 8px;
}
.stat-value {
  font-family: var(--mono); font-size: 32px; font-weight: 700;
  color: var(--text-bright);
}
.stat-value small { font-size: 14px; color: var(--text-dim); font-weight: 400; }
.stat-value .unit, .meta-value .unit { font-size: 16px; color: var(--cyan-dim); font-weight: 500; }

/* ── TABLE ── */
.table-wrap {
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 12px 16px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
  background: #0e121844;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid #1e253020;
  font-size: 13px;
}
tr { transition: background 0.15s; }
tr:hover { background: #ffffff04; }
tr:last-child td { border-bottom: none; }

/* ── BADGES ── */
.eco-badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.3px; border: 1px solid;
}
.eco-npm { color: #ff6b6b; border-color: #ff6b6b33; background: #ff6b6b0a; }
.eco-go { color: #00b4d8; border-color: #00b4d833; background: #00b4d80a; }
.eco-composer { color: #ff8844; border-color: #ff884433; background: #ff88440a; }
.eco-pip, .eco-pyproject { color: #ffc857; border-color: #ffc85733; background: #ffc8570a; }
.eco-ruby { color: #ff4d6a; border-color: #ff4d6a33; background: #ff4d6a0a; }

.sev-badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.sev-critical { color: #ff4d6a; background: #ff4d6a18; border: 1px solid #ff4d6a44; }
.sev-high     { color: #ff8844; background: #ff884418; border: 1px solid #ff884444; }
.sev-moderate { color: #ffc857; background: #ffc85718; border: 1px solid #ffc85744; }
.sev-low      { color: #00e89d; background: #00e89d18; border: 1px solid #00e89d44; }

.vuln-count {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.vuln-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.vuln-dot.critical { background: var(--red); box-shadow: 0 0 6px var(--red); }
.vuln-dot.high     { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.vuln-dot.moderate { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.vuln-dot.low      { background: var(--green); box-shadow: 0 0 6px var(--green); }
.vuln-dot.clean    { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex; gap: 10px; margin-bottom: 28px;
}
.search-bar input, .search-bar select {
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; color: var(--text); font-size: 14px;
  font-family: var(--sans);
  transition: border-color 0.2s;
}
.search-bar input:focus, .search-bar select:focus {
  outline: none; border-color: #2a3a5a;
  box-shadow: 0 0 0 2px #1a2a4a44;
}
.search-bar input { flex: 1; }
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar select { min-width: 150px; cursor: pointer; }
.search-bar button {
  background: var(--bg-elevated);
  color: var(--text); font-weight: 600;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 20px; font-size: 14px; cursor: pointer;
  transition: all 0.2s;
}
.search-bar button:hover {
  background: #1a2a4a;
  border-color: #2a3a5a;
  color: var(--text-bright);
}

/* ── PAGINATION ── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
  font-family: var(--mono); text-decoration: none;
  border: 1px solid var(--border); color: var(--text-dim);
  transition: all 0.2s;
}
.pagination a:hover { border-color: #2a3a5a; color: var(--text-bright); }
.pagination span {
  background: var(--bg-elevated); color: var(--text-bright);
  border-color: #2a3a5a;
}

/* ── SECTION HEADER ── */
.section-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-dim);
  background: #0e121844;
  display: flex; align-items: center; gap: 10px;
}
.section-header .icon { color: var(--cyan); font-size: 16px; }

/* ── LINKS ── */
a { color: #7ab8d4; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--text-bright); }

.pkg-link { color: var(--text-bright); font-weight: 600; }
.pkg-link:hover { color: #7ab8d4; }

/* ── MISC ── */
.mono { font-family: var(--mono); font-size: 12px; }
.dim { color: var(--text-dim); }
.desc-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.empty { padding: 48px; text-align: center; color: var(--text-dim); font-size: 14px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-family: var(--mono); background: #ffffff06; color: var(--text-dim); border: 1px solid #1a2a4a; margin: 2px; }

/* ── HERO (landing) ── */
.hero {
  text-align: center; padding: 100px 24px 60px;
  position: relative;
}
.hero h1 {
  font-family: var(--mono); font-size: clamp(36px, 5vw, 56px); font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -1px; line-height: 1.1;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal; color: var(--cyan);
  text-shadow: 0 0 30px #00d4ff22;
}
.hero .subtitle {
  font-size: 18px; color: var(--text-dim); max-width: 560px;
  margin: 0 auto 40px; line-height: 1.7;
}
.hero .cta {
  display: inline-flex; gap: 12px;
}
.hero .cta a {
  padding: 14px 28px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-decoration: none; transition: all 0.3s;
}
.hero .cta .primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dim));
  color: #060a14;
  box-shadow: 0 0 20px #00d4ff15;
}
.hero .cta .primary:hover {
  box-shadow: 0 0 30px #00d4ff22;
  transform: translateY(-2px);
}
.hero .cta .secondary {
  border: 1px solid var(--border); color: var(--text);
  background: var(--bg-surface);
}
.hero .cta .secondary:hover {
  border-color: #2a3a5a; color: var(--text-bright);
}

/* ── FEATURE GRID ── */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px; margin-bottom: 48px;
}
.feature-card {
  padding: 28px;
}
.feature-card .feat-icon {
  font-size: 28px; margin-bottom: 12px;
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff06; border: 1px solid var(--border);
  color: var(--text-dim);
}
.feature-card h3 {
  font-size: 16px; font-weight: 700; color: var(--text-bright);
  margin-bottom: 8px;
}
.feature-card p { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

/* ── DETAIL PAGE ── */
.detail-header {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 32px; flex-wrap: wrap;
}
.detail-header .title-group { flex: 1; min-width: 300px; }
.detail-header h1 {
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  color: var(--text-bright); margin-bottom: 6px;
}
.detail-header .desc {
  font-size: 15px; color: var(--text-dim); line-height: 1.6;
}
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 32px;
}
.meta-item {
  padding: 16px 20px;
}
.meta-item .meta-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-dim); margin-bottom: 6px;
}
.meta-item .meta-value {
  font-family: var(--mono); font-size: 16px; font-weight: 600;
  color: var(--text-bright);
}
.meta-item .meta-value.warn { color: var(--red); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px; text-align: center;
  font-size: 12px; color: var(--text-dim);
  margin-top: 60px;
}
footer a { color: #7ab8d4; }

/* ── ANALYZE PAGE ── */
.manifest-input {
  width: 100%;
  min-height: 260px;
  padding: 20px;
  background: var(--bg-deep);
  color: var(--text-bright);
  border: none;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  tab-size: 2;
}
.manifest-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}
.manifest-input:focus {
  background: #0a0d11;
  box-shadow: inset 0 0 0 1px #1a2a4a44;
}
.sample-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  margin: 4px 4px 4px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 0.2s;
}
.sample-btn:hover {
  border-color: #2a3a5a;
  color: var(--text-bright);
  background: var(--bg-elevated);
}
.analyze-btn {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dim));
  color: #060a14;
  border: none;
  border-radius: 10px;
  padding: 14px 32px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--sans);
  letter-spacing: 0.2px;
}
.analyze-btn:hover {
  box-shadow: 0 0 30px #00d4ff22;
  transform: translateY(-2px);
}
.analyze-btn:active {
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero { padding: 60px 16px 40px; }
  .hero .cta { flex-direction: column; }
  .container { padding: 20px 16px; }
  .search-bar { flex-direction: column; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .detail-header { flex-direction: column; }
}
