/* ═══════════════════════════════════════════════════════
   ClawBank Bridge — styled to the ClawBank design system
   https://clawbank.co/design-system.html
═══════════════════════════════════════════════════════ */

/* ── Brand fonts (self-hosted, mirrored from clawbank.co) ── */
@font-face {
  font-family: 'PP Nikkei Pacific';
  src: url('fonts/PPNikkeiPacific-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Tiempos Headline';
  src: url('fonts/TiemposHeadline-MediumItalic.otf') format('opentype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #080808;
  --surface: #111111;
  --surface-2: #141210;
  --text: #f0ede6;
  --text-muted: #9d948d;
  --accent: #eb6e12;
  --accent-dim: rgba(235, 110, 18, 0.10);
  --accent-glow: rgba(235, 110, 18, 0.22);
  --border: rgba(240, 237, 230, 0.07);
  --border-hi: rgba(240, 237, 230, 0.14);
  --green: #38d39f;
  --font-display: 'PP Nikkei Pacific', 'Georgia', serif;
  --font-italic: 'Tiempos Headline', 'Georgia', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --nav-h: 64px;
  --max-w: 1060px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.mono { font-family: var(--font-mono); }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1 em, .hero-sub em {
  font-family: var(--font-italic);
  font-style: italic;
  color: var(--accent);
}

/* ── nav (fixed header · 64px) ─────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 10; height: var(--nav-h);
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w); height: 100%; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-family: var(--font-display); font-size: 18px;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 6px; }
.brand em { color: var(--accent); font-style: normal; }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  color: var(--text-muted); font-size: 13px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── hero ──────────────────────────────────────────────── */
.hero { max-width: var(--max-w); margin: 0 auto; padding: 84px 24px 40px; text-align: center; }
.hero h1 { font-size: clamp(2.6rem, 5.2vw, 4.6rem); line-height: 1.08; }
.accent { color: var(--accent); }
.hero-sub {
  max-width: 580px; margin: 22px auto 0;
  color: var(--text-muted); font-size: 15px; font-weight: 300;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  border: 1px solid var(--border-hi); border-radius: 8px;
  background: var(--surface); color: var(--text);
  padding: 11px 18px; font-size: 13px; font-weight: 600;
  font-family: var(--font-mono); cursor: pointer;
  transition: all 0.18s ease;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 18px var(--accent-glow); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--border-hi); box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0a0602; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 0 22px var(--accent-glow); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--accent-dim); text-decoration: none; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 14px; font-size: 14px; margin-top: 16px; }

/* ── cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  transition: border-color 0.18s ease;
}

/* ── section eyebrows ──────────────────────────────────── */
.eyebrow {
  display: inline-block; margin-bottom: 10px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-dim); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px;
}

/* ── manual add details ────────────────────────────────── */
.manual { max-width: 720px; margin: 18px auto 0; text-align: left; }
.manual summary {
  cursor: pointer; text-align: center; list-style: none;
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.manual summary::-webkit-details-marker { display: none; }
.manual summary::after { content: ' ▾'; color: var(--accent); }
.manual[open] summary::after { content: ' ▴'; }
.manual summary:hover { color: var(--text); }
.manual-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px; margin-top: 14px;
}
.manual-grid table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.manual-grid th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.manual-grid td { padding: 8px 14px; border-bottom: 1px solid var(--border); word-break: break-all; }
.manual-grid tr:last-child td { border-bottom: none; }
.manual-grid td:first-child { color: var(--text-muted); white-space: nowrap; width: 1%; padding-right: 20px; }

/* ── bridge widget ─────────────────────────────────────── */
.widget-wrap { max-width: 470px; margin: 28px auto 0; padding: 0 24px; }
.widget { background: var(--surface); }
.widget-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.widget-head h2 { font-size: 22px; }

.direction { display: flex; align-items: stretch; gap: 8px; }
.chain-box {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; min-width: 0;
}
.chain-label {
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--text-muted);
}
.chain-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain-bal { font-size: 11.5px; color: var(--text-muted); }
.flip {
  align-self: center; width: 36px; height: 36px; flex: none;
  border-radius: 50%; border: 1px solid var(--border-hi);
  background: var(--surface-2); color: var(--text); font-size: 15px;
  cursor: pointer; transition: all 0.18s ease;
}
.flip:hover { border-color: var(--accent); color: var(--accent); transform: rotate(180deg); box-shadow: 0 0 14px var(--accent-glow); }

.amount-row {
  display: flex; align-items: center; margin-top: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 14px;
  transition: border-color 0.18s ease;
}
.amount-row:focus-within { border-color: var(--accent); }
#amount {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font-mono); font-weight: 400;
  font-size: 22px; padding: 10px 0; min-width: 0;
}
#amount::placeholder { color: var(--text-muted); opacity: 0.5; }
.amount-side { display: flex; align-items: center; gap: 10px; }
.ticker { font-weight: 600; font-size: 13px; color: var(--text-muted); letter-spacing: 0.04em; }
.btn-max {
  background: var(--accent-dim); color: var(--accent);
  border: none; border-radius: 5px; padding: 4px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  cursor: pointer; font-family: var(--font-mono);
}
.btn-max:hover { box-shadow: 0 0 10px var(--accent-glow); }

.fee-row {
  display: flex; justify-content: space-between;
  margin-top: 14px; font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.fee-row .mono { text-transform: none; letter-spacing: 0; color: var(--text); }

.progress { list-style: none; margin-top: 18px; display: grid; gap: 8px; }
.progress li { font-size: 12.5px; color: var(--text-muted); padding-left: 26px; position: relative; }
.progress li::before {
  content: ''; position: absolute; left: 4px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--border-hi);
}
.progress li.active::before { border-color: var(--accent); animation: pulse 1.2s ease infinite; }
.progress li.done { color: var(--text); }
.progress li.done::before { border-color: var(--green); background: var(--green); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px var(--accent-dim); } }

.status { margin-top: 12px; font-size: 12px; color: var(--text-muted); word-break: break-all; }
.status a { color: var(--green); }

.widget-note {
  margin-top: 14px; font-size: 12.5px; color: var(--text-muted); text-align: center;
}

/* ── sections ──────────────────────────────────────────── */
section { scroll-margin-top: calc(var(--nav-h) + 16px); }
.explain, .markets, .steps, .contracts {
  max-width: var(--max-w); margin: 0 auto; padding: 64px 24px 0;
}
.explain h2, .markets h2, .steps h2, .contracts h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 22px;
}

.explain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.explain-grid .card { border-left: 2px solid transparent; }
.explain-grid .card:hover { border-left-color: var(--accent); }
.explain-grid h3 {
  font-size: 12px; font-weight: 500; margin-bottom: 10px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.explain-grid p { font-size: 13.5px; color: var(--text-muted); }

/* ── markets ───────────────────────────────────────────── */
.markets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.market { background: var(--surface-2); }
.market:hover { border-color: var(--border-hi); }
.market-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.market-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 19px; }
.market-head a { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.market dl { display: grid; gap: 10px; }
.market dl div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.market dt { color: var(--text-muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.market dd { font-size: 13.5px; font-weight: 500; }
.market-note { margin-top: 12px; font-size: 12px; color: var(--text-muted); font-family: var(--font-italic); font-style: italic; }

/* ── steps ─────────────────────────────────────────────── */
.steps-list { max-width: 740px; display: grid; gap: 14px; padding-left: 0; counter-reset: step; list-style: none; }
.steps-list li {
  counter-increment: step; position: relative; padding: 18px 18px 18px 74px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  font-size: 13.5px; color: var(--text-muted);
  transition: border-color 0.18s ease;
}
.steps-list li:hover { border-color: var(--border-hi); }
.steps-list li strong { color: var(--text); font-weight: 600; }
.steps-list li::before {
  content: '0' counter(step); position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-size: 26px; color: var(--accent);
}
.steps-list em { font-family: var(--font-italic); color: var(--text); }
.steps-list code {
  font-family: var(--font-mono); font-size: 11.5px; background: var(--surface-2);
  border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px;
}

/* ── contracts ─────────────────────────────────────────── */
.contracts table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.contracts td { padding: 12px; border-bottom: 1px solid var(--border); }
.contracts td:first-child {
  color: var(--text-muted); white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 11.5px;
}
.contracts a { word-break: break-all; }

/* ── footer ────────────────────────────────────────────── */
.footer {
  max-width: var(--max-w); margin: 72px auto 0; padding: 32px 24px 44px;
  border-top: 1px solid var(--border); text-align: center;
}
.footer-links { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a {
  color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer p { font-size: 12px; color: var(--text-muted); }
.footer p em { font-family: var(--font-italic); color: var(--text); }

@media (max-width: 560px) {
  .direction { flex-direction: column; }
  .flip { transform: rotate(90deg); }
  .flip:hover { transform: rotate(270deg); }
}
