/* Solv Protocol (solv-protocol.org) — shared stylesheet
   Neutral, content-first theme. One file for the whole site. */

:root {
  --ink: #14161a;
  --text: #2b2f36;
  --muted: #5b626d;
  --bg: #ffffff;
  --surface: #f5f6f3;
  --surface-2: #eef0ea;
  --border: #e2e5df;
  --accent: #b4540a;       /* muted amber, Bitcoin-adjacent, not a brand copy */
  --accent-ink: #8a3f07;
  --accent-soft: #fbf1e6;
  --good: #1f6b3b;
  --warn: #8a5a00;
  --danger: #9a2b2b;
  --radius: 10px;
  --maxw: 74rem;
  --prose: 44rem;
  --shadow: 0 1px 2px rgba(20,22,26,.06), 0 6px 24px rgba(20,22,26,.05);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --- Accessibility --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: .7rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* --- Layout --- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(1.1) blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}
.brand:hover { color: var(--ink); }
.brand svg { display: block; }
.brand .tld { color: var(--muted); font-weight: 600; }

.primary-nav { margin-left: auto; }
.primary-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .15rem;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  display: inline-block;
  padding: .4rem .65rem;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: .98rem;
  font-weight: 500;
}
.primary-nav a:hover { background: var(--surface); color: var(--ink); }
.primary-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

/* --- Breadcrumbs --- */
.breadcrumbs { padding: .9rem 0 0; font-size: .9rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.breadcrumbs li::after { content: "/"; margin-left: .35rem; color: var(--border); }
.breadcrumbs li:last-child::after { content: ""; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* --- Main / prose --- */
main { display: block; }
.page { padding: 1.5rem 0 3.5rem; }
.prose { max-width: var(--prose); }
.prose.wide { max-width: 60rem; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.7rem); margin: .2rem 0 .6rem; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.8rem); margin: 2.2rem 0 .6rem; padding-top: .4rem; }
h3 { font-size: 1.22rem; margin: 1.6rem 0 .4rem; }
h4 { font-size: 1.05rem; margin: 1.2rem 0 .3rem; }

.lead { font-size: 1.2rem; color: var(--muted); margin: .4rem 0 1.4rem; }

p, ul, ol { margin: 0 0 1.05rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { color: var(--accent); }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

code, kbd, samp { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--surface); padding: 1rem; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--border); }
pre code { background: none; padding: 0; }

blockquote {
  margin: 1.2rem 0;
  padding: .2rem 0 .2rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

/* --- Tables --- */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .96rem; }
caption { text-align: left; color: var(--muted); font-size: .9rem; padding: .6rem .8rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface); color: var(--ink); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

/* --- Callouts --- */
.note {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1.4rem 0;
}
.note > :last-child { margin-bottom: 0; }
.note .note-title { font-weight: 700; color: var(--ink); display: block; margin-bottom: .25rem; }
.note.security { border-left-color: var(--danger); background: #fcf4f4; }
.note.tip { border-left-color: var(--good); background: #f1f8f3; }
.note.data { border-left-color: var(--warn); background: #fbf6ec; }

/* --- Hero (home) --- */
.hero { padding: 2.2rem 0 1rem; }
.hero .lead { max-width: 42rem; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft);
  padding: .25rem .6rem; border-radius: 100px; margin-bottom: .8rem;
}

/* --- Cards / hub grid --- */
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  background: var(--bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card h3 { margin: .1rem 0 .35rem; font-size: 1.12rem; }
.card h3 a { text-decoration: none; }
.card p { color: var(--muted); font-size: .97rem; margin-bottom: .6rem; }
.card .card-more { margin-top: auto; font-weight: 600; font-size: .92rem; }

/* --- Stat strip --- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.6rem 0; }
.stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: var(--surface); }
.stat .num { font-size: 1.5rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.stat .lbl { font-size: .85rem; color: var(--muted); }

/* --- Figures / SVG --- */
figure { margin: 1.6rem 0; }
figure svg { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
figcaption { font-size: .88rem; color: var(--muted); margin-top: .5rem; }

/* --- Definition list (glossary) --- */
.terms { display: grid; gap: .2rem; }
.terms dt { font-weight: 700; color: var(--ink); margin-top: 1.1rem; scroll-margin-top: 5rem; }
.terms dd { margin: .2rem 0 0; color: var(--text); }

/* --- Related --- */
.related { margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 1.4rem; }
.related h2 { margin-top: 0; font-size: 1.2rem; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; grid-template-columns: repeat(2, 1fr); }
.related a { font-weight: 600; }
.related .desc { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 2rem; }
.footer-inner { padding: 2.4rem 0 2rem; display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
.site-footer h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 .7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .3rem 0; }
.site-footer a { color: var(--text); text-decoration: none; font-size: .96rem; }
.site-footer a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-about p { color: var(--muted); font-size: .95rem; margin-top: 0; }
.footer-brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); margin-bottom: .6rem; }
.footer-legal { border-top: 1px solid var(--border); padding: 1.1rem 0 2rem; font-size: .85rem; color: var(--muted); }
.footer-legal p { margin: .3rem 0; }
.socials { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.socials a {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--border); border-radius: 100px; padding: .3rem .7rem;
  font-size: .88rem; background: var(--bg);
}

/* --- Utility --- */
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.nowrap { white-space: nowrap; }
.tag { display:inline-block; font-size:.78rem; font-weight:600; color:var(--accent-ink); background:var(--accent-soft); padding:.15rem .5rem; border-radius:100px; }

/* --- FAQ --- */
.faq-item { padding: 1.2rem 0; border-bottom: 1px solid var(--border); max-width: var(--prose); }
.faq-item:first-of-type { border-top: 1px solid var(--border); }
.faq-item h2 { margin: 0 0 .4rem; font-size: 1.18rem; }
.faq-item p { margin: 0; color: var(--text); }

/* --- 404 --- */
.notfound { text-align: center; padding: 4rem 0; }
.notfound .code { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -.03em; }

/* --- Responsive --- */
@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .primary-nav { margin-left: 0; width: 100%; }
  .primary-nav ul { gap: .15rem; }
  .primary-nav a { padding: .35rem .5rem; font-size: .92rem; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .related ul { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
