:root {
  --bg: #ffffff;
  --fg: #0f1115;
  --muted: #5b616e;
  --line: #e7e9ee;
  --accent: #0052ff;
  --card: #f7f8fa;
  --warn-bg: #fff7e6;
  --warn-line: #f5d9a3;
  --max: 720px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0f;
    --fg: #eef0f3;
    --muted: #9aa1ad;
    --line: #22252c;
    --accent: #5b8cff;
    --card: #14161b;
    --warn-bg: #1d1a12;
    --warn-line: #4a3d1c;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd { font-family: var(--mono); font-size: .88em; }
kbd {
  padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; background: var(--card);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Header */
header.site {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  z-index: 10;
}
header.site .bar {
  max-width: 1040px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--fg); letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }

header.site nav { display: flex; justify-content: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
header.site nav::-webkit-scrollbar { display: none; }
header.site nav a {
  color: var(--muted); font-size: 15px; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; transition: color .15s, background .15s;
}
header.site nav a:hover { color: var(--fg); background: var(--card); text-decoration: none; }
header.site nav a[aria-current="page"] { color: var(--fg); background: var(--card); font-weight: 600; }

.tools { display: flex; align-items: center; gap: 8px; }
.verified {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 5px 10px 5px 8px; border: 1px solid var(--line); border-radius: 999px;
  transition: color .15s, border-color .15s;
}
.verified svg { width: 15px; height: 15px; fill: var(--accent); }
.verified:hover, .verified[aria-current="page"] { color: var(--fg); border-color: var(--accent); text-decoration: none; }
.term-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  font: 600 15px/1 var(--mono); color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 8px;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.term-btn:hover { color: var(--fg); border-color: var(--accent); }

main.wrap { padding-top: 72px; padding-bottom: 112px; }

h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 20px; }
h2 { font-size: 22px; letter-spacing: -0.015em; margin: 40px 0 12px; }
p { margin: 0 0 16px; }
.lede { font-size: 20px; color: var(--muted); margin-bottom: 32px; }

/* Home hero */
.hero { display: flex; gap: 32px; align-items: center; margin-bottom: 36px; }
.hero img {
  width: 132px; height: 132px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--line);
}
.hero h1 { margin-bottom: 6px; }
.hero .lede { margin: 0; }

.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 48px 0 12px;
}
.follow { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 500; }
.follow:hover { color: var(--accent); text-decoration: none; }
.follow svg { width: 16px; height: 16px; fill: currentColor; }
.follow .handle { color: var(--muted); font-weight: 400; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile {
  display: block; padding: 18px 18px 20px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--fg);
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.tile strong { display: block; font-weight: 600; margin-bottom: 4px; }
.tile span { display: block; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Live block heights (Bitcoin and Base) */
.blocks { display: flex; flex-direction: column; gap: 10px; margin-top: 64px; }
.block-height {
  --c: 247,147,26;
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  font: 12px/1 var(--mono); color: var(--muted); letter-spacing: .02em;
}
.block-height.base { --c: 0,82,255; }
.block-height:hover { color: var(--fg); text-decoration: none; }
.block-height[hidden] { display: none; }
.block-height .dot { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c)); animation: pulse 2.4s infinite; }
.block-height.new-block:not(.base) .dot { animation: pulse .6s 3; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--c),.55); } 70% { box-shadow: 0 0 0 8px rgba(var(--c),0); } 100% { box-shadow: 0 0 0 0 rgba(var(--c),0); } }
@media (prefers-reduced-motion: reduce) { .block-height .dot { animation: none; } }

/* Lists */
ul.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
ul.list li { border-bottom: 1px solid var(--line); }
ul.list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; color: var(--fg);
}
ul.list a:hover { text-decoration: none; color: var(--accent); }
ul.list .meta { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
ul.accounts .meta { font-family: var(--mono); font-size: 13px; }

/* Talks */
ul.talks { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
ul.talks li { border-bottom: 1px solid var(--line); }
ul.talks a {
  display: grid; grid-template-columns: 1fr auto; column-gap: 16px;
  padding: 16px 0; color: var(--fg);
}
ul.talks a:hover { text-decoration: none; }
ul.talks a:hover .title { color: var(--accent); }
ul.talks .show { grid-column: 1; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
ul.talks .title { grid-column: 1; }
ul.talks .meta { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Beliefs */
ol.beliefs { list-style: none; padding: 0; margin: 0; counter-reset: belief; }
ol.beliefs li { counter-increment: belief; position: relative; padding: 28px 0 24px 56px; border-top: 1px solid var(--line); }
ol.beliefs li::before {
  content: counter(belief, decimal-leading-zero);
  position: absolute; left: 0; top: 31px;
  font: 600 14px/1 var(--mono); color: var(--accent);
}
ol.beliefs h2 { margin: 0 0 8px; font-size: 21px; }
ol.beliefs p { color: var(--muted); }
ol.beliefs .refs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
ol.beliefs .refs a {
  font-size: 13px; padding: 4px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--fg);
}
ol.beliefs .refs a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Projects timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.timeline li:first-child { border-top: 1px solid var(--line); }
.timeline .year { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .name { font-weight: 600; }
.timeline p { margin: 2px 0 0; color: var(--muted); }

/* Policy tabs (Good Intentions / Progress) */
nav.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
nav.tabs a { padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
nav.tabs a:hover { color: var(--fg); text-decoration: none; }
nav.tabs a[aria-current="page"] { background: var(--bg); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }

/* Policy cards */
.policy { border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 16px; background: var(--card); }
.policy h2 { margin: 0 0 14px; font-size: 20px; }
.policy dl { margin: 0; display: grid; gap: 12px; }
.policy dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.policy dd { margin: 2px 0 0; }
.policy .sources a { display: block; font-size: 14px; word-break: break-all; }
.note { color: var(--muted); font-size: 15px; margin-top: 24px; }

/* Official accounts */
.warning { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 14px; padding: 18px 22px; margin-bottom: 8px; }
.warning strong { display: block; font-size: 17px; margin-bottom: 6px; }
.warning p { margin: 0; color: var(--muted); }
.address {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.address .label { font-size: 13px; color: var(--muted); }
.address code { flex: 1; min-width: 0; word-break: break-all; font-size: 14px; }
.copy {
  font: 500 13px/1 inherit; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  color: var(--fg); background: var(--bg); border: 1px solid var(--line);
}
.copy:hover { border-color: var(--accent); }

@media (max-width: 860px) {
  header.site .bar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; height: auto; padding-top: 10px; padding-bottom: 6px; row-gap: 6px; }
  header.site nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; margin: 0 -12px; padding: 0 12px; }
  .tools { justify-self: end; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 32px; }
  main.wrap { padding-top: 48px; padding-bottom: 80px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero img { width: 104px; height: 104px; }
  .tiles { grid-template-columns: 1fr; }
  .verified span { display: none; }
  .verified { padding: 6px; }
  ol.beliefs li { padding-left: 40px; }
  ul.list .meta { font-size: 13px; }
}
