/* BlockchainTips design system (shared component library, themed) */

:root {
  --bg: #fbfbfe;
  --surface: #f3f4fb;
  --surface-2: #e9ebf8;
  --line: #dde0f2;
  --line-strong: #c5cbec;
  --ink: #131327;
  --ink-2: #302f4c;
  --muted: #63628a;
  --accent: #3453d1;
  --accent-hover: #2740a8;
  --accent-soft: #e9edfd;
  --ok: #0a7048;
  --ok-soft: #e7f4ee;
  --warn: #9a5b00;
  --warn-soft: #fdf3e2;
  --bad: #b0241c;
  --bad-soft: #fdeceb;
  --shadow-sm: 0 1px 2px rgba(16, 21, 31, .05), 0 1px 3px rgba(16, 21, 31, .04);
  --shadow-md: 0 2px 4px rgba(16, 21, 31, .04), 0 8px 20px rgba(16, 21, 31, .07);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e1a;
    --surface: #141527;
    --surface-2: #191b30;
    --line: #262a45;
    --line-strong: #343a5c;
    --ink: #ebecfa;
    --ink-2: #c6c8e6;
    --muted: #8d90b8;
    --accent: #8195ff;
    --accent-hover: #a1b0ff;
    --accent-soft: #1b2040;
    --ok: #4cc38a;
    --ok-soft: #10241c;
    --warn: #e0a960;
    --warn-soft: #241c10;
    --bad: #f27a72;
    --bad-soft: #2a1513;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 45rem; margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff;
  padding: .6rem 1rem; z-index: 100; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */
header.top {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
header.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.9rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--ink); font-weight: 640; font-size: 1.06rem;
  letter-spacing: -.015em; text-decoration: none; white-space: nowrap;
}
.brand svg { display: block; }
header.top nav { display: flex; flex-wrap: wrap; gap: .25rem; }
header.top nav a {
  color: var(--muted); font-size: .9rem; font-weight: 500; text-decoration: none;
  padding: .35rem .6rem; border-radius: 7px;
}
header.top nav a:hover { color: var(--ink); background: var(--surface-2); }

/* ---------- typography ---------- */
main { padding: 2.6rem 0 4rem; }
h1 {
  font-size: clamp(1.85rem, 1.35rem + 2vw, 2.4rem);
  line-height: 1.18; letter-spacing: -.025em; font-weight: 700;
  color: var(--ink); margin: 0 0 1rem;
}
h2 {
  font-size: 1.3rem; line-height: 1.32; letter-spacing: -.015em; font-weight: 650;
  color: var(--ink); margin: 2.6rem 0 .75rem;
}
h3 { font-size: 1.08rem; font-weight: 620; color: var(--ink); margin: 1.8rem 0 .5rem; }
p { margin: 0 0 1.15rem; }
a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
strong { color: var(--ink); font-weight: 620; }
ul, ol { padding-left: 1.35rem; margin: 0 0 1.15rem; }
li { margin-bottom: .55rem; }
li::marker { color: var(--muted); }
blockquote {
  border-left: 3px solid var(--accent); margin: 1.5rem 0;
  padding: .1rem 0 .1rem 1.1rem; color: var(--ink-2); font-style: normal;
}

.kicker {
  font-size: .76rem; font-weight: 640; text-transform: uppercase;
  letter-spacing: .095em; color: var(--accent); margin: 0 0 .65rem;
}
.lede { font-size: 1.16rem; line-height: 1.62; color: var(--ink-2); }
.updated { font-size: .84rem; color: var(--muted); margin: -.4rem 0 1.9rem; }
.small { font-size: .87rem; color: var(--muted); }

.crumb { font-size: .84rem; color: var(--muted); margin-bottom: 1.25rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb span { margin: 0 .3rem; opacity: .55; }

/* ---------- hero ---------- */
.hero { padding: .5rem 0 1rem; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.75rem); }
.hero .lede { font-size: 1.24rem; max-width: 38rem; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.5rem; margin: 1.6rem 0;
}
.card h2, .card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.feature {
  background: linear-gradient(180deg, var(--accent-soft), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 14px; padding: 1.6rem 1.6rem 1.5rem; margin: 1.8rem 0;
  box-shadow: var(--shadow-sm);
}
.feature h2 { margin-top: 0; }

/* ---------- tool ---------- */
.tool {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 1.6rem; margin: 2rem 0;
  box-shadow: var(--shadow-md);
}
.tool h2 { margin-top: 0; font-size: 1.18rem; }
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: 11px;
  padding: 2.2rem 1rem; text-align: center; color: var(--muted);
  cursor: pointer; background: var(--bg);
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop.hover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.drop p { margin: .2rem 0; }
.drop strong { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--accent); color: #fff; border: 0; border-radius: 9px;
  padding: .68rem 1.25rem; font-family: inherit; font-size: .96rem; font-weight: 580;
  cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .08s ease;
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }

input[type="text"], input[type="url"] {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line-strong);
  border-radius: 9px; font-size: .97rem; font-family: var(--mono);
  background: var(--bg); color: var(--ink);
}
input[type="url"]:focus, input[type="text"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ---------- verdicts ---------- */
.verdict {
  border-radius: 11px; padding: 1.1rem 1.25rem; margin-top: 1.2rem;
  border: 1px solid; border-left-width: 4px;
}
.verdict h3 { margin: 0 0 .55rem; font-size: 1.04rem; }
.verdict ul { margin-bottom: .4rem; }
.verdict p:last-child { margin-bottom: 0; }
.verdict.bad { background: var(--bad-soft); border-color: var(--bad); }
.verdict.bad h3 { color: var(--bad); }
.verdict.warn { background: var(--warn-soft); border-color: var(--warn); }
.verdict.warn h3 { color: var(--warn); }
.verdict.ok { background: var(--ok-soft); border-color: var(--ok); }
.verdict.ok h3 { color: var(--ok); }

.safeword {
  font-family: var(--mono); font-size: 1.6rem; font-weight: 600; letter-spacing: .01em;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: .9rem; text-align: center; margin: .7rem 0; color: var(--ink);
}

/* ---------- hub grid ---------- */
.hubgrid {
  display: grid; gap: .7rem; margin: 1.5rem 0; padding-left: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
}
.hubgrid li { margin: 0; }
.hubgrid a {
  display: block; height: 100%; padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-size: .94rem; font-weight: 520; color: var(--ink); text-decoration: none;
  line-height: 1.45; transition: border-color .14s ease, box-shadow .14s ease, transform .1s ease;
}
.hubgrid a:hover {
  border-color: var(--accent); box-shadow: var(--shadow-md);
  transform: translateY(-2px); color: var(--accent);
}

/* ---------- toc ---------- */
.toc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 1rem 1.25rem; margin: 1.8rem 0;
}
.toc p { font-size: .78rem; font-weight: 640; text-transform: uppercase;
  letter-spacing: .085em; color: var(--muted); margin: 0 0 .5rem; }
.toc ul { list-style: none; padding-left: 0; margin: 0; }
.toc li { margin-bottom: .35rem; }
.toc a { font-size: .93rem; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 1.4rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { border-bottom: 1px solid var(--line); padding: .65rem .8rem; text-align: left; vertical-align: top; }
th { background: var(--surface); font-weight: 620; color: var(--ink); }
tr:last-child td { border-bottom: 0; }

/* ---------- related ---------- */
.related { border-top: 1px solid var(--line); margin-top: 3.2rem; padding-top: 1.6rem; }
.related h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 0 0 .9rem; font-weight: 640; }
.related ul { display: grid; gap: .55rem; list-style: none; padding-left: 0;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.related li { margin: 0; }
.related a { font-size: .93rem; text-decoration: none; font-weight: 500; }
.related a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
footer {
  background: var(--surface); border-top: 1px solid var(--line);
  margin-top: 4rem; color: var(--muted);
}
footer .wrap { padding: 2.2rem 1.25rem; font-size: .88rem; }
footer p { margin: 0 0 .7rem; max-width: 40rem; }
footer a { color: var(--ink-2); }
footer a:hover { color: var(--accent); }
.footlinks { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 1rem; }
.footlinks a { text-decoration: none; font-weight: 500; }
.footlinks a:hover { text-decoration: underline; }

/* ---------- diagrams and mockups ---------- */
figure.diagram { margin: 1.9rem 0 2.2rem; }
figure.diagram svg { width: 100%; height: auto; display: block; }
figure.diagram figcaption {
  font-size: .82rem; color: var(--muted); margin-top: .6rem; text-align: center;
}

.mock-label {
  display: flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 640;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .7rem;
}
.mock-label svg { flex: none; }

.phone-mock {
  max-width: 22rem; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; padding: 1rem .9rem 1.1rem;
  box-shadow: var(--shadow-md);
}
.phone-mock .thread-head {
  font-size: .78rem; color: var(--muted); text-align: center; margin-bottom: .7rem;
  padding-bottom: .6rem; border-bottom: 1px solid var(--line);
}
.phone-mock .thread-head strong { color: var(--ink); display: block; font-size: .88rem; }
.bubble {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 16px 16px 16px 4px;
  padding: .75rem .95rem; font-size: .93rem; line-height: 1.5; color: var(--ink);
  position: relative; max-width: 90%;
}
.bubble.call { border-radius: 14px; font-style: normal; }
.bubble .tag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  color: var(--bad); background: var(--bad-soft); border-radius: 4px; padding: .1rem .4rem;
  margin-bottom: .4rem; text-transform: uppercase;
}

.card-mock {
  max-width: 24rem; margin: 0 auto; background: var(--surface);
  border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 1.3rem 1.4rem;
  text-align: center;
}
.card-mock .cm-head { font-size: .72rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; }
.card-mock .cm-msg { font-size: 1.05rem; font-weight: 620; color: var(--ink); margin-bottom: .8rem; line-height: 1.4; }
.card-mock .cm-qr {
  width: 84px; height: 84px; margin: 0 auto .8rem; border-radius: 8px;
  background: repeating-linear-gradient(45deg, var(--ink) 0 3px, transparent 3px 6px),
              repeating-linear-gradient(-45deg, var(--ink) 0 3px, transparent 3px 6px);
  background-blend-mode: multiply; opacity: .82; border: 1px solid var(--line-strong);
}
.card-mock .cm-foot { font-size: .78rem; color: var(--muted); }

.callouts { list-style: none; padding: 0; margin: 1.1rem 0 0; max-width: 26rem; margin-left: auto; margin-right: auto; }
.callouts li {
  display: flex; gap: .65rem; margin-bottom: .55rem; font-size: .89rem; color: var(--ink-2);
}
.callouts .num {
  flex: none; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: .74rem; font-weight: 700; display: flex; align-items: center;
  justify-content: center; margin-top: .1rem;
}

.url-anatomy {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.3rem 1.4rem; margin: 1.6rem 0; overflow-x: auto;
}
.url-anatomy .u-line {
  font-family: var(--mono); font-size: 1.02rem; white-space: nowrap; margin-bottom: .9rem;
}
.url-anatomy .u-decoy { color: var(--muted); }
.url-anatomy .u-real { color: var(--bad); font-weight: 700; background: var(--bad-soft); border-radius: 4px; padding: .05rem .15rem; }
.url-anatomy .u-path { color: var(--muted); }
.url-anatomy .u-key {
  display: flex; gap: .55rem; align-items: flex-start; font-size: .87rem; color: var(--ink-2); margin-top: .5rem;
}
.url-anatomy .u-key .dot { flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: var(--bad); margin-top: .4rem; }

/* ---------- filter controls (comparison tools, checklists) ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; gap: .9rem 1.4rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 1rem 1.2rem; margin: 1.4rem 0 1.6rem; font-family: var(--font); font-size: .92rem;
}
.filterbar label { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--ink-2); }
.filterbar input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); cursor: pointer; }
.filterbar select {
  padding: .4rem .6rem; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: .92rem; cursor: pointer;
}
.filterbar select:focus, .filterbar input:focus-visible {
  outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 4px;
}

.progress-track { background: var(--line); border-radius: 999px; height: .5rem; overflow: hidden; margin: .3rem 0 1rem; }
.progress-fill { background: var(--accent); height: 100%; border-radius: 999px; transition: width .25s ease; }

.checklist-item {
  display: flex; align-items: flex-start; gap: .7rem; padding: .8rem 0; border-bottom: 1px solid var(--line);
}
.checklist-item:last-child { border-bottom: 0; }
.checklist-item input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--accent); flex: none; cursor: pointer; }
.checklist-item label { cursor: pointer; }
.checklist-item .ci-title { font-weight: 600; color: var(--ink); display: block; margin-bottom: .15rem; }
.checklist-item .ci-note { font-size: .88rem; color: var(--muted); }

/* Homepage category icons */
.cathead { display: flex; align-items: center; gap: .55rem; }
.cathead svg { flex: none; }
.cathead h2 { margin: 0; }

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  header.top .wrap { min-height: auto; padding-top: .7rem; padding-bottom: .7rem; }
  header.top nav { width: 100%; gap: .1rem; }
  header.top nav a { padding: .3rem .5rem; font-size: .855rem; }
  main { padding-top: 1.8rem; }
  .hubgrid { grid-template-columns: 1fr; }
}

@media print {
  header.top, footer, .related, .no-print { display: none; }
  body { background: #fff; color: #000; }
}
