@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input[type="text"],
input[type="number"],
input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
}

:root {
  --bg:      #000;
  --text:    #fff;
  --sub:     rgba(255,255,255,0.60);
  --dim:     rgba(255,255,255,0.28);
  --line:    rgba(255,255,255,0.12);
  --yellow:  #f5c518;
  --accent:  #f7931a;
  --r:       12px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--sub);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* ── Shell ── */

.shell {
  width: 100%;
  max-width: 390px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  .shell {
    max-width: 560px;
    padding: 0 40px;
  }
}

/* ── Nav ── */

nav {
  padding: 52px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 22px;
  width: auto;
  display: block;
  /* logo is white - visible on dark nav background */
}

.nav-link {
  font-size: 0.85rem;
  color: var(--sub);
  text-decoration: none;
}
.nav-link:hover { color: var(--text); }

/* ── Hero ── */

.hero {
  padding: 52px 0 44px;
}

.hero h1 {
  font-size: clamp(36px, 9vw, 44px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 14px;
  color: var(--text);
}

.hero-bitcoin {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(247,147,26,0.18);
}

.hero p {
  font-size: 15px;
  color: var(--sub);
  line-height: 1.55;
  letter-spacing: -0.01em;
}

/* ── Mode tabs ── */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  background: rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 4px;
}

.tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-radius: 10px;
  color: rgba(255,255,255,0.45);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  text-align: center;
}

.tab:hover {
  color: rgba(255,255,255,0.7);
}

.tab.on {
  background: rgba(255,255,255,0.13);
  color: var(--text);
}

/* ── Blurb ── */

.blurb {
  font-size: 14px;
  color: var(--sub);
  line-height: 1.6;
  letter-spacing: -0.005em;
  margin-bottom: 36px;
  white-space: pre-line;
}

/* ── Field ── */

.field {
  margin-bottom: 12px;
}

.field-name {
  font-size: 13px;
  color: var(--sub);
  letter-spacing: -0.005em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Advanced button ── */

.adv-btn {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.adv-btn:hover { color: var(--sub); }

.adv-btn-active {
  color: var(--yellow);
}

.adv-btn-active:hover { color: var(--yellow); }

/* ── Modal ── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: #111;
  border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 28px 28px 40px;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 11;
}

.modal.open {
  transform: translateX(-50%) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--sub);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.modal-close:hover { background: rgba(255,255,255,0.14); }

.modal-field {
  margin-bottom: 28px;
}

.modal-label {
  display: block;
  font-size: 12px;
  color: var(--sub);
  letter-spacing: -0.005em;
  margin-bottom: 10px;
}

.modal-input-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 10px;
  transition: border-color 0.15s;
}

.modal-input-wrap:focus-within {
  border-bottom-color: var(--text);
}

.modal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.modal-input::-webkit-outer-spin-button,
.modal-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.modal-input::placeholder { color: var(--dim); }

.modal-unit {
  font-size: 14px;
  color: var(--sub);
  flex-shrink: 0;
}

.modal-hint {
  font-size: 12px;
  color: var(--sub);
  margin-top: 7px;
  letter-spacing: -0.005em;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.modal-reset {
  flex: 1;
  padding: 14px;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: var(--r);
  color: var(--sub);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.modal-reset:hover { background: rgba(255,255,255,0.1); }

.modal-apply {
  flex: 2;
  padding: 14px;
  background: var(--text);
  border: none;
  border-radius: var(--r);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.modal-apply:hover { opacity: 0.88; }

/* ── Option pills ── */

.options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.opt {
  padding: 9px 18px;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--sub);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  white-space: nowrap;
}

.opt:hover {
  border-color: var(--dim);
  color: var(--text);
}

.opt.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ── Budget input ── */

.budget-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.budget-wrap:focus-within {
  border-bottom-color: var(--text);
}

.budget-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: clamp(32px, 9vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.budget-input::-webkit-outer-spin-button,
.budget-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.budget-input::placeholder {
  color: var(--dim);
}

.budget-unit {
  font-size: 20px;
  font-weight: 400;
  color: var(--sub);
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

/* ── Custom duration ── */

.custom-dur-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 8px;
  transition: border-color 0.15s;
}

.custom-dur-wrap:focus-within {
  border-bottom-color: var(--text);
}

.custom-dur-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  outline: none;
  width: 80px;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.custom-dur-input::-webkit-outer-spin-button,
.custom-dur-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.custom-dur-input::placeholder {
  color: var(--dim);
}

.custom-dur-unit {
  font-size: 14px;
  color: var(--sub);
}

.hashrate-result {
  font-size: 13px;
  color: var(--sub);
  letter-spacing: -0.01em;
  min-height: 18px;
  margin-bottom: 6px;
}

.block-prob {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: -0.01em;
  min-height: 16px;
  margin-bottom: 8px;
}

/* ── Address input ── */

.addr-wrap {
  margin-bottom: 40px;
}

.addr-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  padding: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  font-family: "SF Mono", ui-monospace, "Fira Code", monospace;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.15s;
  border-radius: 0;
  -webkit-appearance: none;
}

.addr-input::placeholder {
  color: var(--dim);
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.01em;
}

.addr-input:focus {
  border-bottom-color: var(--text);
}

.addr-hint {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: -0.005em;
  margin-top: 8px;
}

/* ── Price ── */

.price-section {
  padding: 28px 0 32px;
  border-top: 1px solid var(--line);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.price-amount {
  font-size: clamp(48px, 12vw, 60px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.price-unit {
  font-size: 20px;
  font-weight: 400;
  color: var(--sub);
  letter-spacing: -0.02em;
}

.price-meta {
  font-size: 13px;
  color: var(--dim);
  letter-spacing: -0.005em;
}

/* ── CTA ── */

.btn-pay {
  width: 100%;
  padding: 18px 24px;
  background: var(--text);
  border: none;
  border-radius: var(--r);
  color: var(--bg);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.08s;
  margin-bottom: 16px;
}

.btn-pay:hover  { opacity: 0.9; }
.btn-pay:active { transform: scale(0.985); }

.btn-pay:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  transform: none;
}

/* ── Fine print ── */

.fine {
  text-align: center;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.7;
  padding-bottom: 60px;
  letter-spacing: -0.005em;
}

.fine a {
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.fine a:hover { color: var(--sub); }

/* ════════ ORDER PAGE ════════ */

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--sub);
  text-decoration: none;
  padding: 40px 0 0;
  letter-spacing: -0.01em;
}

.back:hover { color: var(--text); }

.order-header {
  padding: 36px 0 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.order-title {
  font-size: 13px;
  color: var(--sub);
  letter-spacing: -0.005em;
  margin-bottom: 8px;
}

.order-amount {
  font-size: clamp(48px, 12vw, 60px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--text);
}

.order-amount span {
  font-size: 20px;
  font-weight: 400;
  color: var(--sub);
  letter-spacing: -0.02em;
  margin-left: 8px;
}

/* Status chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-top: 16px;
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.chip-pending  .chip-dot { background: #ffd60a; }
.chip-mining   .chip-dot { background: var(--yellow); animation: blink 1.8s ease infinite; }
.chip-complete .chip-dot { background: var(--dim); }
.chip-expired  .chip-dot { background: var(--accent); }

.chip-pending  { color: #ffd60a; }
.chip-mining   { color: var(--yellow); }
.chip-complete { color: var(--sub); }
.chip-expired  { color: var(--accent); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* QR */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 8px 0 32px;
}

.qr-frame {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  display: inline-flex;
}

.qr-frame canvas,
.qr-frame img { display: block; width: 180px; height: 180px; }

.bolt11 {
  width: 100%;
  font-size: 11px;
  font-family: "SF Mono", ui-monospace, monospace;
  color: var(--dim);
  word-break: break-all;
  text-align: center;
  line-height: 1.6;
}

.btn-copy {
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  color: var(--sub);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  padding: 10px 28px;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: border-color 0.12s, color 0.12s;
}

.btn-copy:hover { border-color: var(--sub); color: var(--text); }

/* Details list */
.dlist {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-bottom: 32px;
}

.drow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.drow:last-child { border-bottom: none; }

.dkey { color: var(--sub); }

.dval {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dval.mono {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mining countdown */
.countdown-section {
  text-align: center;
  padding: 16px 0 40px;
}

.countdown-label {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.countdown-num {
  font-size: clamp(52px, 14vw, 68px);
  font-weight: 700;
  letter-spacing: -0.06em;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.countdown-sub {
  font-size: 13px;
  color: var(--dim);
  margin-top: 8px;
}

/* Complete/expired states */
.end-section {
  padding: 40px 0;
  text-align: center;
}

.end-section p {
  font-size: 15px;
  color: var(--sub);
  line-height: 1.6;
  margin: 16px 0 32px;
  letter-spacing: -0.01em;
}

/* ── Orders page ── */

.orders-header {
  padding: 40px 0 28px;
}

.orders-header h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  color: var(--text);
}

.orders-sub {
  font-size: 14px;
  color: var(--sub);
}

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: #fff;
  transition: opacity 0.15s;
}

.order-row:hover { opacity: 0.7; }

.order-row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-row-type {
  font-size: 15px;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: -0.01em;
}

.order-row-date {
  font-size: 12px;
  color: var(--sub);
}

.order-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.order-row-sats {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.chip-sm {
  font-size: 11px;
  padding: 3px 8px;
}

.orders-token-wrap {
  margin-top: 36px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.orders-token-label {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 10px;
}

.orders-token-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.orders-token-url {
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
  flex: 1;
}

.btn-copy-small {
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Address page order cards ── */

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.order-cancel-btn {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.order-cancel-btn:hover { color: #f87171; }

/* ── Nav search ── */
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  padding: 7px 12px;
  transition: border-color 0.15s;
  margin: 0;
  /* prevent form default styles */
  -webkit-appearance: none;
  appearance: none;
}
.nav-search:focus-within {
  border-color: rgba(255,255,255,0.22);
}
.nav-search svg {
  color: rgba(255,255,255,0.32);
  flex-shrink: 0;
  display: block;
  pointer-events: none;
}
.nav-search input {
  -webkit-appearance: none;
  appearance: none;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  letter-spacing: -0.01em;
  width: 150px;
  padding: 0;
  margin: 0;
  line-height: 1;
}
.nav-search input::placeholder {
  color: rgba(255,255,255,0.28);
}
@media (max-width: 480px) {
  .nav-search { display: none; }
}

/* ── Budget unit toggle (sats / BTC) ── */
.budget-unit-btc {
  color: var(--accent);
  font-size: 16px;
}

/* ── Fine print link ── */
.fine-link {
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  transition: color 0.15s;
}
.fine-link:hover { color: var(--sub); }

/* ── Responsive ── */
@media (max-width: 390px) {
  .shell { padding: 0 20px; }
}

/* ════════ DESKTOP INDEX LAYOUT ════════ */

@media (min-width: 900px) {

  body {
    align-items: flex-start;
  }

  .shell {
    max-width: 1200px;
    padding: 0 60px;
    width: 100%;
  }

  nav {
    padding: 44px 0 0;
  }

  /* Two-column grid */
  .index-layout {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 80px;
    align-items: start;
    padding-top: 64px;
    padding-bottom: 80px;
  }

  /* Left column: hero + features + lookup */
  .index-left {
    padding-top: 8px;
  }

  .hero {
    padding: 0 0 48px;
  }

  .hero h1 {
    font-size: 72px;
    letter-spacing: -0.055em;
    line-height: 1.0;
    margin-bottom: 20px;
  }

  .hero p {
    font-size: 17px;
    line-height: 1.6;
  }

  /* Right column: floating card */
  .index-right {
    background: #0a0a0a;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 36px;
    position: sticky;
    top: 40px;
  }

  /* Fine print inside the card — keep compact */
  .index-right .fine {
    padding-bottom: 0;
    margin-top: 16px;
  }
}

@media (max-width: 899px) {
  .index-layout { display: block; }
  .bchain-wrap  { display: none; }
}

/* ── Blockchain canvas ── */
.bchain-wrap {
  margin-top: 64px;
  min-height: 220px;
  width: 100%;
  position: relative;
}
