/* Consensus Change Standards — landing site
   Design mirrors the print cover: GitHub-dark ground, Bitcoin-orange accent,
   cream display, Palatino body (echoes the book's mathpazo). Authored, not generated.
   Dark is the default; [data-theme="light"] is the light palette (toggle in the header). */

:root {
  color-scheme: dark;
  --bg:        #0d1117;
  --bg-soft:   #121821;
  --panel:     #161b22;
  --panel-2:   #1c2230;
  --border:    #2b3340;
  --border-hi: #3d4654;
  --text:      #c9d1d9;
  --text-hi:   #e6edf3;
  --muted:     #8b949e;
  --cream:     #f5f1e6;   /* headings / bright text */
  --orange:    #f7931a;   /* brand accent — FILLS (buttons, logo, outlines) */
  --orange-hi: #ffab3d;
  --link:      #f7931a;   /* accent as TEXT (links, eyebrows, tags) — AA-tuned per theme */
  --link-hi:   #ffab3d;
  --green:     #3fb950;
  --yellow:    #d29922;
  --red:       #f85149;
  --header-bg: rgba(13,17,23,.86);
  --hero-1:    #0f141c;
  --hero-glow: rgba(247,147,26,.10);
  --shadow:    0 18px 50px rgba(0,0,0,.55);
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;
  --maxw: 1080px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #f6f7f9;
  --bg-soft:   #edf1f4;
  --panel:     #ffffff;
  --panel-2:   #eef2f5;
  --border:    #e4e8ec;
  --border-hi: #d3dae0;
  --text:      #39414b;
  --text-hi:   #14181d;
  --muted:     #5b6470;
  --cream:     #14181d;
  --orange:    #f7931a;
  --orange-hi: #e8850f;
  --link:      #b8690a;
  --link-hi:   #915207;
  --green:     #2e9b57;
  --yellow:    #b1820a;
  --red:       #cf3b3b;
  --header-bg: rgba(246,247,249,.85);
  --hero-1:    #eef2f7;
  --hero-glow: rgba(247,147,26,.08);
  --shadow:    0 14px 38px rgba(20,24,30,.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hi); text-decoration: underline; }
h1, h2, h3 { color: var(--cream); line-height: 1.15; font-weight: 700; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem;
  font-family: var(--mono); color: var(--link); margin: 0 0 .6rem; }

/* ---- skip link + a11y ---- */
.skip { position:absolute; left:-999px; top:0; background:var(--orange); color:#0d1117;
  padding:.5rem .9rem; border-radius:0 0 6px 0; z-index:100; font-family:var(--mono); font-size:.85rem; }
.skip:focus { left:0; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 3px; }

/* ---- header ---- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
header.site .wrap { display: flex; align-items: center; gap: 1.2rem; height: 60px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--cream);
  font-size: 1.02rem; letter-spacing: .01em; }
.brand:hover { text-decoration: none; color: var(--cream); }
.brand img { width: 26px; height: 26px; }
nav.top { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; }
nav.top a { color: var(--muted); font-size: .95rem; }
nav.top a:hover { color: var(--cream); text-decoration: none; }
@media (max-width: 640px){ nav.top a.hide-sm { display:none; } .brand .full { display:none; } nav.top { gap: 1rem; } }

/* ---- theme toggle ---- */
.theme-toggle { background: transparent; border: 1px solid var(--border-hi); color: var(--muted);
  width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; padding: 0; flex: 0 0 auto;
  transition: color .15s ease, border-color .15s ease; }
.theme-toggle:hover { color: var(--link-hi); border-color: var(--orange); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .ico-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: inline; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--serif);
  font-size: 1rem; font-weight: 700; padding: .72rem 1.3rem; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; transition: transform .08s ease, background .15s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: #0d1117; }
.btn-primary:hover { background: var(--orange-hi); color: #0d1117; }
.btn-ghost { background: transparent; color: var(--cream); border-color: var(--border-hi); }
.btn-ghost:hover { border-color: var(--orange); color: var(--link-hi); }
.btn .arw { font-size: 1.05em; }

/* ---- hero ---- */
.hero { border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 420px at 78% -8%, var(--hero-glow), transparent 60%),
    linear-gradient(180deg, var(--hero-1), var(--bg)); }
.hero .wrap { display: grid; grid-template-columns: 1.35fr .95fr; gap: 3rem;
  align-items: center; padding-top: 4.2rem; padding-bottom: 4.2rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.35rem); margin: .2rem 0 .5rem; letter-spacing: -.01em; }
.hero .sub { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--text-hi); margin: 0 0 1rem; }
.hero .byline { color: var(--muted); font-size: .98rem; margin: 0 0 1.6rem; }
.hero .byline b { color: var(--cream); font-weight: 700; }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.4rem; }
.doi-badges { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; font-size: .85rem; color: var(--muted);
  font-family: var(--mono); }
.doi-badges a { color: var(--muted); border-bottom: 1px dotted var(--border-hi); }
.doi-badges a:hover { color: var(--link); text-decoration: none; }
.cover-frame { justify-self: end; }
.cover-frame img { width: 320px; max-width: 100%; border-radius: 6px;
  border: 1px solid var(--border-hi); box-shadow: var(--shadow); }
@media (max-width: 860px){
  .hero .wrap { grid-template-columns: 1fr; gap: 2rem; }
  .cover-frame { justify-self: center; order: -1; }
  .cover-frame img { width: 220px; }
}

/* ---- sections ---- */
section { padding: 3.6rem 0; border-bottom: 1px solid var(--border); }
section h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .4rem; }
section .lede { color: var(--muted); max-width: 62ch; margin: 0 0 1.8rem; }
.lead-p { font-size: 1.06rem; max-width: 68ch; }
.lead-p + .lead-p { margin-top: 1rem; }

/* ---- what's inside grid ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 720px){ .grid { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.15rem 1.25rem; }
.card h3 { font-size: 1.06rem; margin: 0 0 .35rem; color: var(--cream); }
.card .tag { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--link); }
.card p { margin: .3rem 0 0; font-size: .96rem; color: var(--text); }

/* ---- scorecard callout ---- */
.callout { background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-hi); border-radius: 14px; padding: 1.8rem; }
.callout.sc { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
@media (max-width: 720px){ .callout.sc { grid-template-columns: 1fr; } }
.scores { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.chip { font-family: var(--mono); font-size: .82rem; padding: .28rem .6rem; border-radius: 999px;
  border: 1px solid var(--border-hi); color: var(--text-hi); white-space: nowrap; }
.chip .dot { display:inline-block; width:.6rem; height:.6rem; border-radius:50%; margin-right:.4rem;
  vertical-align: baseline; }
.dot.g { background: var(--green); } .dot.y { background: var(--yellow); } .dot.r { background: var(--red); }

/* ---- BIP-110 timeline ---- */
.timeline { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--red);
  border-radius: 10px; padding: 1.3rem 1.4rem; margin-top: 1.4rem; }
.timeline .row { display: flex; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.timeline .row:last-child { border-bottom: 0; }
.timeline .when { font-family: var(--mono); color: var(--link); min-width: 8.5rem; font-size: .92rem; }
.timeline .what { color: var(--text); }
.timeline .what b { color: var(--cream); }

/* ---- cite block ---- */
.cite { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem 1.3rem; font-size: .98rem; }
.cite blockquote { margin: 0; color: var(--text-hi); font-style: italic; }
.cite .dois { margin-top: .9rem; font-family: var(--mono); font-size: .84rem; color: var(--muted);
  display: grid; gap: .3rem; }

/* ---- author ---- */
.author p { max-width: 70ch; }
.links-inline { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; margin-top: .8rem;
  font-family: var(--mono); font-size: .88rem; }

/* ---- footer ---- */
footer.site { padding: 2.6rem 0 3.4rem; color: var(--muted); font-size: .9rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--link); }
.fp { margin-left: auto; display: inline-flex; align-items: center; gap: .6rem; }
.fp:hover { text-decoration: none; }
.fp-label { color: var(--muted); font-size: .9rem; }
.fp-logo { height: 46px; width: 46px; opacity: .78; transition: opacity .15s ease; }
.fp:hover .fp-logo { opacity: 1; }
@media (max-width: 640px){ .fp { margin-left: 0; } }

/* light-mode: the print cover is dark, so soften its frame on a light ground */
:root[data-theme="light"] .cover-frame img { border-color: var(--border); }

/* reduce motion */
@media (prefers-reduced-motion: reduce){ * { scroll-behavior: auto !important; transition: none !important; } }
