/* StackBay Dark Infrastructure Storefront Theme */
:root {
  --bg: #070a10;
  --surface: #0d131f;
  --surface-2: #121a2b;
  --border: rgba(148, 163, 184, 0.16);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.08), transparent 45%),
              radial-gradient(circle at 85% 12%, rgba(251, 113, 133, 0.06), transparent 40%),
              var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}

code, pre { font-family: var(--mono); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Alert Ribbon */
.alert-ribbon {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.2), rgba(245, 158, 11, 0.15));
  border-bottom: 1px solid rgba(251, 113, 133, 0.3);
  padding: 9px 16px;
  font-size: 13px;
  text-align: center;
  color: #fecdd3;
}
.alert-ribbon code {
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 5px;
  color: #fff;
}
.ribbon-link {
  color: #fde68a;
  font-weight: 700;
  margin-left: 8px;
}
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  margin-right: 8px;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.25);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 16, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none !important;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #38bdf8, #34d399);
  color: #03151e;
  font-weight: 900;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.brand-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent);
  letter-spacing: 0.06em;
}
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 13.5px; }
.nav-links a { color: #cbd5e1; font-weight: 500; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-cta {
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--green) !important;
  font-weight: 700 !important;
}
@media (max-width: 760px) {
  .nav-links { display: none; }
}

/* Hero */
.hero { padding: 56px 0 36px; text-align: center; }
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.badge-red { background: rgba(244, 63, 94, 0.14); color: #fda4af; border-color: rgba(244, 63, 94, 0.35); }
.badge-green { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
.badge-cyan { background: rgba(14, 165, 233, 0.14); color: #7dd3fc; border-color: rgba(14, 165, 233, 0.35); }

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0 auto 16px;
  max-width: 860px;
  color: #f8fafc;
}
.grad-red {
  background: linear-gradient(135deg, #fb7185, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 720px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 16.5px;
}
.hero-sub strong { color: #f1f5f9; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 34px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none !important;
  transition: transform 0.12s, filter 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #38bdf8 0%, #34d399 100%);
  color: #03151e;
}
.btn-secondary {
  background: var(--surface-2);
  border-color: rgba(148, 163, 184, 0.25);
  color: #f1f5f9;
}
.btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}
.btn-danger {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}
.btn-unlocked {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
  width: 100%;
  margin-top: 8px;
}
.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 8px; }

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 820px) { .hero-metrics { grid-template-columns: repeat(2, 1fr); } }
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
}
.metric-val { font-family: var(--mono); font-size: 22px; font-weight: 800; color: #f8fafc; }
.metric-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Sections */
.section { padding: 54px 0; }
.section-alt { background: rgba(13, 19, 31, 0.65); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.section-head h2 { margin: 0 0 10px; font-size: clamp(24px, 3.5vw, 34px); letter-spacing: -0.025em; color: #f8fafc; }
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* Tool Switcher */
.tool-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 720px) { .tool-switcher { grid-template-columns: 1fr; } }
.tool-tab {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.tool-tab.active {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.12), rgba(13, 19, 31, 0.95));
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25) inset;
}
.tab-num { font-family: var(--mono); font-size: 11px; color: var(--accent); font-weight: 700; }
.tab-desc { font-size: 12.5px; color: var(--muted); }

.tool-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
}
.tool-panel.active { display: block; }

/* TCO Controls */
.tco-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 760px) { .tco-controls { grid-template-columns: 1fr; } }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group label { font-size: 13px; font-weight: 600; color: #cbd5e1; }
.field-input {
  width: 100%;
  background: #080c14;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  padding: 9px 12px;
  color: #f8fafc;
  font-size: 13.5px;
}
.field-sm { max-width: 180px; padding: 6px 10px; font-size: 12.5px; }
input[type="range"] { width: 100%; accent-color: #38bdf8; }
.check-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #080c14;
  border: 1px solid var(--border);
  font-size: 12px !important;
  cursor: pointer;
}

.tco-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 16px;
  font-size: 14px;
}

.table-wrap { overflow-x: auto; }
.tco-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tco-table th, .tco-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.tco-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tco-price { font-family: var(--mono); font-weight: 800; font-size: 15px; color: #f8fafc; }
.tco-save { font-family: var(--mono); font-weight: 700; color: var(--green); }
.tco-over { font-family: var(--mono); font-weight: 700; color: var(--red); }
.pill-mini {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}
.disclosure-note { font-size: 11.5px; color: #64748b; margin: 12px 0 0; }

/* Scanner */
.scanner-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
}
@media (max-width: 860px) { .scanner-grid { grid-template-columns: 1fr; } }
.scanner-privacy {
  font-size: 12.5px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 8px 12px;
  border-radius: 9px;
  margin-bottom: 12px;
}
.dropzone {
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  background: rgba(8, 12, 20, 0.7);
  margin-bottom: 12px;
}
.dropzone.dragover { border-color: #34d399; background: rgba(16, 185, 129, 0.08); }
.dropzone p { margin: 0 0 10px; font-size: 13.5px; }
.link-btn {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.dropzone-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.code-area {
  width: 100%;
  background: #06090f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: #cbd5e1;
  font-family: var(--mono);
  font-size: 12px;
  resize: vertical;
}

.empty-results {
  background: #080c14;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  height: 100%;
}
.empty-results h3 { margin: 0 0 8px; }
.empty-results ul { padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.empty-results li { margin-bottom: 6px; }

.scan-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #080c14;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.grade-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  font-family: var(--mono);
}
.grade-F, .grade-D { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.45); }
.grade-C { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.45); }
.grade-B, .grade-A { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.45); }

.finding-list { display: flex; flex-direction: column; gap: 9px; max-height: 410px; overflow-y: auto; }
.finding-item {
  padding: 11px 13px;
  border-radius: 10px;
  background: #080c14;
  border-left: 3px solid var(--muted);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.finding-item.sev-critical { border-left-color: #f43f5e; }
.finding-item.sev-high { border-left-color: #fb923c; }
.finding-item.sev-medium { border-left-color: #fbbf24; }
.finding-item.sev-low { border-left-color: #38bdf8; }
.finding-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sev-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.sev-tag.critical { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.sev-tag.high { background: rgba(251, 146, 60, 0.2); color: #fdba74; }
.sev-tag.medium { background: rgba(251, 191, 36, 0.2); color: #fde68a; }
.sev-tag.low { background: rgba(56, 189, 248, 0.2); color: #bae6fd; }
.finding-fix { margin-top: 6px; color: #6ee7b7; font-size: 12px; }

/* Packs Grid */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 940px) { .packs-grid { grid-template-columns: 1fr; } }
.pack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.pack-featured {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.12);
}
.pack-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
  margin-bottom: 10px;
}
.pack-tag-cyan { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.pack-tag-gold { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
.pack-card h3 { margin: 0 0 8px; font-size: 19px; color: #f8fafc; }
.pack-price { margin-bottom: 10px; }
.price-amt { font-family: var(--mono); font-size: 32px; font-weight: 900; color: #fff; }
.price-unit { font-size: 12px; color: var(--muted); }
.pack-desc { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.pack-files {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  flex: 1;
  font-size: 12.5px;
  color: #cbd5e1;
}
.pack-files li {
  padding: 6px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}
.pack-files code { color: #7dd3fc; font-size: 11.5px; }
.pack-actions .btn-primary { width: 100%; }

/* Templates */
.templates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 760px) { .templates-grid { grid-template-columns: 1fr; } }
.tpl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tpl-head h3 { margin: 0; font-size: 16px; color: #f8fafc; }
.tpl-card p { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.tpl-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* x402 Box */
.x402-box {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 20px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
@media (max-width: 860px) { .x402-box { grid-template-columns: 1fr; } }
.x402-box h2 { margin: 0 0 10px; font-size: 24px; color: #f8fafc; }
.x402-box p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.x402-meta { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #cbd5e1; }
.code-snippet {
  margin: 0;
  background: #06090f;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  font-size: 12px;
  color: #a7f3d0;
}

/* DFY Form */
.dfy-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 18px;
  padding: 28px;
}
@media (max-width: 820px) { .dfy-card { grid-template-columns: 1fr; } }
.dfy-info h2 { margin: 0 0 10px; font-size: 26px; color: #f8fafc; }
.dfy-info p { color: var(--muted); font-size: 14.5px; }
.dfy-list { padding-left: 18px; color: #cbd5e1; font-size: 13.5px; }
.dfy-list li { margin-bottom: 7px; }
.dfy-form { display: flex; flex-direction: column; gap: 12px; }
.dfy-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: #cbd5e1; }
.form-status {
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
  font-size: 13px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 16px; }
