/* MuseBank — Obsidian. Sleek, clean, no pixels. */
:root {
  --bg: #07090c;
  --bg-soft: #0b0e13;
  --surface: rgba(255, 255, 255, 0.032);
  --surface-2: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.055);
  --text: #eef2ef;
  --text-2: #a7b0ab;
  --text-3: #6d7672;
  --accent: #34d399;
  --accent-deep: #059669;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --gold: #e6c46a;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --radius: 20px;
  --radius-sm: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(52, 211, 153, 0.09), transparent 70%),
    radial-gradient(700px 380px at 85% 10%, rgba(230, 196, 106, 0.05), transparent 70%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(52, 211, 153, 0.28); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input { font-family: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(7, 9, 12, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand #logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border), 0 8px 24px -8px rgba(52, 211, 153, 0.35);
  flex: none;
}

.brand h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tagline {
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: 0.01em;
  margin: 1px 0 6px;
}

.ca-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.ca-chip:hover { border-color: rgba(52, 211, 153, 0.45); background: var(--surface-2); }
.ca-chip .ca-label { font-weight: 600; color: var(--text); letter-spacing: 0.02em; }
.ca-chip code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}
.ca-chip .ca-icon { width: 13px; height: 13px; color: var(--text-3); flex: none; transition: color 0.2s; }
.ca-chip:hover .ca-icon { color: var(--text-2); }
.ca-chip .ca-check { display: none; width: 13px; height: 13px; color: var(--accent); flex: none; }
.ca-chip.copied { border-color: rgba(52, 211, 153, 0.6); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
.ca-chip.copied .ca-icon { display: none; }
.ca-chip.copied .ca-check { display: block; }

.connect-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.connect-msg { font-size: 12.5px; color: var(--text-2); min-height: 1em; }

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(255,255,255,0.2); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, #34d399 0%, #10b981 55%, #059669 100%);
  border: none;
  color: #04120c;
  box-shadow: 0 10px 28px -10px rgba(52, 211, 153, 0.55);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 14px 32px -10px rgba(52, 211, 153, 0.65); }

.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface); }

.btn.small { padding: 7px 14px; font-size: 12.5px; min-height: 0; }

/* ---------- layout ---------- */
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

section { min-width: 0; }

.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* ---------- swap / trade card ---------- */
.buybar { scroll-margin-top: 90px; }

.swap-box {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.swap-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(52,211,153,0.5), transparent);
  pointer-events: none;
}

.swap-head { margin-bottom: 18px; }
.swap-head h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.buy-note { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.buy-note a { font-weight: 600; }

.swap-row { margin-bottom: 6px; }
.swap-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.swap-label .est { font-weight: 400; color: var(--text-3); }
.swap-bal { font-weight: 400; color: var(--text-3); display: inline-flex; align-items: center; gap: 8px; }
.swap-bal #swap-bal { font-variant-numeric: tabular-nums; color: var(--text-2); }

.swap-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px 8px 6px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.swap-input:focus-within {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}
.swap-input .tok {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.06em;
  flex: none;
}
.swap-input input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  padding: 10px 4px;
}
.swap-input input::placeholder { color: var(--text-3); opacity: 0.55; }
.swap-input input[readonly] { cursor: default; }
/* hide number spinners */
.swap-input input[type="number"]::-webkit-outer-spin-button,
.swap-input input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.swap-input input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.swap-arrow {
  display: flex;
  justify-content: center;
  margin: 2px 0;
}
.swap-arrow::after {
  content: "\2193";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 16px;
}

.swap-info {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 12px 0 4px;
  font-variant-numeric: tabular-nums;
}

/* chart */
.price-chart { margin: 18px 0 6px; }
.price-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.price-label { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.price-link { font-size: 13px; font-weight: 600; }
#dexscreener-embed {
  width: 100%;
  height: 360px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #000;
  display: block;
}
.chart-stats { display: flex; gap: 12px; margin-top: 12px; }
.chart-stat {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 14px;
}
.chart-stat .k { font-size: 12.5px; color: var(--text-3); font-weight: 600; letter-spacing: 0.02em; }
.chart-stat .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

.swap-box .row { display: flex; gap: 10px; margin-top: 16px; }
.msg { font-size: 13.5px; margin-top: 10px; min-height: 1.2em; color: var(--text-2); }
.msg.ok { color: var(--accent); }
.msg.err { color: var(--danger); }
.msg a { font-weight: 600; }

/* ---------- prose sections ---------- */
.intro p {
  font-size: 16.5px;
  color: var(--text-2);
  max-width: 68ch;
  letter-spacing: -0.005em;
}
.intro strong { color: var(--text); font-weight: 650; }
.deploy-note {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--gold);
  background: rgba(230, 196, 106, 0.08);
  border: 1px solid rgba(230, 196, 106, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
}
.hidden { display: none !important; }

/* collapsibles */
.collapsible {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.collapsible > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.collapsible > summary::-webkit-details-marker { display: none; }
.d-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.d-toggle {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-2);
  font-size: 13px;
  transition: transform 0.25s ease, background 0.2s;
}
.d-toggle::before { content: "\203A"; transform: rotate(90deg); display: block; line-height: 1; }
.collapsible[open] .d-toggle { transform: rotate(180deg); background: var(--surface-2); }
.collapsible > summary:hover .d-toggle { border-color: rgba(52,211,153,0.4); color: var(--accent); }

.tradeoffs ul, .how ol {
  padding: 0 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text-2);
}
.tradeoffs ul { list-style: none; }
.tradeoffs li {
  padding-left: 22px;
  position: relative;
}
.tradeoffs li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.85;
}
.how ol { list-style: none; counter-reset: step; }
.how li { padding-left: 34px; position: relative; counter-increment: step; }
.how li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.tradeoffs strong, .how strong { color: var(--text); }
.fine {
  padding: 0 22px 20px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- vaults ---------- */
.vaults {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.vault {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.vault::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230,196,106,0.45), transparent);
  pointer-events: none;
}
.vault h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.vault .pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  width: fit-content;
  margin-top: -8px;
}
.vault .blurb { font-size: 13.5px; color: var(--text-2); }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.stat { background: rgba(0, 0, 0, 0.28); padding: 12px 14px; }
.stat .k { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.stat .v { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

.vault .row { display: flex; gap: 10px; }
.vault .row .btn { flex: none; }

.amount {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.amount::placeholder { color: var(--text-3); opacity: 0.6; font-weight: 400; }
.amount:focus { border-color: rgba(52, 211, 153, 0.55); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14); }
.amount[type="number"]::-webkit-outer-spin-button,
.amount[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.amount[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.slider-row { display: flex; align-items: center; gap: 12px; }
.pct-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
input[type="range"].pct {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 0%), rgba(255,255,255,0.12) var(--fill, 0%));
  outline: none;
  cursor: pointer;
}
input[type="range"].pct:disabled { opacity: 0.4; cursor: not-allowed; }
input[type="range"].pct::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5), 0 0 0 4px rgba(52,211,153,0.18);
  cursor: pointer;
}
input[type="range"].pct::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5), 0 0 0 4px rgba(52,211,153,0.18);
  cursor: pointer;
}
input[type="range"].pct::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}
input[type="range"].pct::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.vault .addr {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  word-break: break-all;
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
}
.vault .msg { margin-top: 0; }
.vault.pending { opacity: 0.75; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border-soft);
  padding: 26px 24px 40px;
  text-align: center;
}
footer p { font-size: 13px; color: var(--text-3); letter-spacing: 0.02em; }

/* ---------- focus ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .brand #logo { width: 38px; height: 38px; border-radius: 11px; }
  .brand h1 { font-size: 17px; }
  .tagline { font-size: 11.5px; }
  .ca-chip { font-size: 12px; padding: 6px 10px; }
  .btn { min-height: 48px; }
  .btn.small { min-height: 0; padding: 6px 12px; }

  main { padding: 18px 14px 48px; gap: 16px; }

  .swap-box { padding: 18px 16px; border-radius: 20px; }
  .swap-head h2 { font-size: 21px; }
  .swap-input input { font-size: 26px; }
  #dexscreener-embed { height: 300px; }
  .chart-stats { flex-direction: column; gap: 8px; }
  .chart-stat { padding: 9px 12px; }
  .chart-stat .k { font-size: 12px; }
  .chart-stat .v { font-size: 14.5px; }

  .intro p { font-size: 15px; }

  .vault { padding: 18px 16px; }
  .vault .addr { font-size: 10.5px; }
  .stat { padding: 10px 12px; }
  .stat .v { font-size: 15px; }

  .collapsible > summary { padding: 14px 16px; }
  .tradeoffs ul, .how ol { padding: 0 16px 16px; font-size: 14px; }
  .fine { padding: 0 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
