/*
 * Orbit Discovery client — palette & design language.
 * Base: Bengji's Orbit demo page (orbit-demo.html, Nov 1, iCloud copy; not in this repo):
 *   --bg #070b14, --card #0f1623, --border #1e2a3a, --cyan #00e5d0, --cyan-dim #00b8a8,
 *   --orange #ff7a3d, --text #e8eef6, --muted #8b9bb4, pre #0a1018, boost border #3d2a1f,
 *   error #f87171, hover tints rgba(0,229,208,.1) / rgba(255,122,61,.1); Inter 400-700;
 *   16px cards, pill outline buttons, 720px column, conic cyan/orange logo mark.
 * Accents (brand values, not in the demo):
 *   --btc #F7931A Bitcoin orange (sats / Lightning markers only)
 *   --kas #70C7BA, --kas-bright #49EACB Kaspa teal/turquoise (encryption indicators)
 *   --nostr #662482 Nostr purple = fill of the official logo SVGs, github.com/mbarulli/nostr-logo
 */
:root {
  --bg: #070b14;
  --card: #0f1623;
  --border: #1e2a3a;
  --cyan: #00e5d0;
  --cyan-dim: #00b8a8;
  --orange: #ff7a3d;
  --text: #e8eef6;
  --muted: #8b9bb4;
  --pre: #0a1018;
  --boost-border: #3d2a1f;
  --error: #f87171;
  --btc: #F7931A;
  --kas: #70C7BA;
  --kas-bright: #49EACB;
  --nostr: #662482;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--cyan); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem 0; }
main.wrap:focus { outline: none; }

/* Header — same structure as the demo */
.topbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; align-items: center; max-width: 720px; margin: 0 auto; padding: 1rem 1.25rem 0; }
.hero { text-align: center; margin-bottom: 2rem; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; }
.logo-mark { width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(from 200deg, var(--cyan), var(--orange), var(--cyan)); position: relative; }
.logo-mark::after { content: ""; position: absolute; inset: 6px; background: var(--bg); border-radius: 50%; }
.tagline { margin: 0.4rem 0 0; font-size: 0.95rem; letter-spacing: 0.18em; color: var(--orange); font-weight: 600; }
.sub { color: var(--muted); margin-top: 0.5rem; }
h1.sub { font-size: 1.05rem; font-weight: 500; }

/* Cards & buttons — demo values */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; margin: 1rem 0; }
.card h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.card.boost { border-color: var(--boost-border); }
button, .btn { display: inline-block; text-decoration: none; background: transparent; color: var(--cyan); border: 1.5px solid var(--cyan); padding: 0.7rem 1.4rem; border-radius: 999px; font: 600 0.95rem Inter, system-ui, sans-serif; cursor: pointer; transition: all 0.15s; }
button.orange, .btn.orange { color: var(--orange); border-color: var(--orange); }
button:hover, .btn:hover { background: rgba(0,229,208,0.1); }
button.orange:hover, .btn.orange:hover { background: rgba(255,122,61,0.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.small { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
pre, .invoice code { display: block; background: var(--pre); border: 1px solid var(--border); padding: 0.9rem; border-radius: 10px; overflow-x: auto; font-size: 0.8rem; color: var(--cyan); margin: 0.75rem 0; word-break: break-all; white-space: pre-wrap; }
.muted { color: var(--muted); font-size: 0.9rem; }
.ok { color: var(--cyan); }
.price { font-size: 1.4rem; font-weight: 700; color: var(--cyan); }
.price.orange { color: var(--orange); }

/* Identifier input — Nostr-branded */
.lookup { display: flex; gap: 0.6rem; align-items: center; background: var(--card); border: 1.5px solid var(--nostr); border-radius: 999px; padding: 0.35rem 0.35rem 0.35rem 0.6rem; }
.lookup:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }
.lookup input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: 0.95rem ui-monospace, Menlo, Consolas, monospace; padding: 0.55rem 0.3rem; outline: none; }
.lookup input::placeholder { color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 600; border-radius: 999px; padding: 0.15rem 0.65rem; white-space: nowrap; border: 1px solid transparent; }
.badge-nostr { background: var(--nostr); color: #fff; }
.badge-boost { color: var(--orange); border-color: var(--orange); }
.badge-premium { color: var(--cyan); border-color: var(--cyan); }
.badge-public { color: var(--muted); border-color: var(--border); }
.badge-enc { color: var(--kas-bright); border-color: var(--kas); }
.badge-plain { color: var(--orange); border-color: var(--orange); }
.sats { color: var(--btc); font-weight: 700; }
.nostr-link { color: #fff; background: var(--nostr); border-radius: 6px; padding: 0.05rem 0.45rem; text-decoration: underline; text-underline-offset: 2px; }
.npub { font-size: 0.75rem; color: var(--muted); word-break: break-all; }

/* Results */
.alert { color: var(--error); border-color: var(--error); }
.summary h2 { font-size: 1.15rem; }
.zap-hint { color: var(--text); font-size: 0.9rem; margin: 0.6rem 0 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--btc); background: rgba(247,147,26,.08); border-radius: 0 8px 8px 0; }
.top { color: var(--cyan); }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.rank-pill { font-weight: 700; color: var(--orange); }
.score-big { font-size: 1.6rem; font-weight: 700; color: var(--cyan); }
.score-big small { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.preview { margin: 0.9rem 0; padding: 0.6rem 0.9rem; border-left: 3px solid var(--nostr); color: var(--muted); white-space: pre-wrap; word-break: break-word; font-size: 0.9rem; }
.comps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.comp-head { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.9rem; }
.comp-label { font-weight: 600; }
.comp-val { color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; }
.bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin: 0.35rem 0; }
.bar span { display: block; height: 100%; background: var(--cyan); }
.comp-engagement .bar span { background: var(--orange); }
.comp-interest .bar span { background: var(--cyan-dim); }
.comp-recency .bar span { background: var(--muted); }
.comp-text { margin: 0; font-size: 0.85rem; color: var(--muted); }
.extra { color: var(--orange); font-size: 0.85rem; margin: 0.6rem 0 0; }
.note-actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.prices { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 0.4rem; }

/* Security explainer — lock colour only on genuinely encrypted items */
.pay-sec { color: var(--kas-bright); font-size: 0.85rem; }
.sec-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.security h2 { font-size: 1rem; }
.sec-col h3 { margin: 0 0 0.4rem; font-size: 0.9rem; }
.sec-col ul { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--muted); }
.sec-enc h3 { color: var(--kas-bright); }
.sec-e2e h3 { color: var(--muted); }
.sec-pub h3 { color: var(--text); }
footer { text-align: center; max-width: 720px; margin: 2.5rem auto 0; padding: 0 1.25rem 4rem; color: var(--muted); font-size: 0.85rem; }
footer a { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 560px) { .lookup { flex-wrap: wrap; border-radius: 16px; } .lookup button { width: 100%; } }
.pay-confirm { border-color: var(--orange); }
.pay-confirm h3 { color: var(--orange); font-size: 1.1rem; }
.lang-switch { display: inline-flex; align-items: center; gap: 0.3rem; }
.globe { font-size: 1rem; }
.lang-btn[aria-pressed="true"] { background: rgba(0,229,208,0.15); }
.lang-btn[aria-pressed="false"] { color: var(--muted); border-color: var(--border); }

/* How the score is calculated (static, EN/FR via data-i18n) */
.how-link { text-align: center; margin: 0.75rem 0 0; font-size: 0.9rem; }
.how h2 { font-size: 1.2rem; }
.how-grid { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.how-item { border-left: 3px solid var(--cyan); padding: 0.1rem 0 0.1rem 0.8rem; }
.how-engagement { border-left-color: var(--orange); }
.how-interest { border-left-color: var(--cyan-dim); }
.how-recency { border-left-color: var(--muted); }
.how-item h3 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.how-item p { margin: 0 0 0.4rem; font-size: 0.88rem; color: var(--muted); }

.cta h2 { font-size: 1rem; }

/* Accessibility: visible keyboard focus, skip link, reduced motion, narrow screens */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
/* the input itself has no ring: the whole pill gets it (.lookup:focus-within) */
.lookup input:focus-visible { outline: none; }
h2[tabindex="-1"]:focus, h3[tabindex="-1"]:focus { outline: none; }
h2[tabindex="-1"]:focus-visible, h3[tabindex="-1"]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.skip-link { position: absolute; left: 0.75rem; top: -3rem; z-index: 10; background: var(--card); color: var(--cyan); border: 1.5px solid var(--cyan); border-radius: 999px; padding: 0.5rem 1rem; font-weight: 600; }
.skip-link:focus { top: 0.75rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (max-width: 420px) {
  .topbar { justify-content: center; }
  .topbar .badge { white-space: normal; }
  .logo { font-size: 2rem; }
  .card { padding: 1.1rem; }
  .comp-head { flex-wrap: wrap; }
}

/* Coming-soon placeholder pages (/faq, /privacy, /terms) */
.coming h1 { font-size: 1.6rem; font-weight: 700; margin: 1.25rem 0 0; letter-spacing: -0.02em; }
.coming .coming-soon { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.25rem; }
.coming .card { text-align: center; }

/* Orbit Premium tools (orbit-premium.js / premium-app.js) */
.premium .pr-perks { margin: 0.25rem 0 1rem; padding-left: 1.2rem; color: var(--text); font-size: 0.9rem; }
.premium .pr-perks li { margin: 0.2rem 0; }
.pr-form { display: grid; gap: 0.35rem; margin: 0.75rem 0; }
.pr-form label { font-size: 0.85rem; color: var(--text); }
.pr-form input, .pr-form select { background: var(--pre); color: var(--text); border: 1px solid var(--muted); border-radius: 10px; padding: 0.5rem 0.7rem; font: 0.9rem Inter, system-ui, sans-serif; min-width: 0; }
.pr-form input:focus-visible, .pr-form select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pr-err { color: var(--error); }
.pr-result { margin-top: 1rem; }
.pr-table-wrap { overflow-x: auto; max-width: 100%; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.pr-table th, .pr-table td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; word-break: break-word; }
.pr-table th { color: var(--text); font-weight: 600; }
