/* Dark theme is the default; light theme overrides below. */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-raised: #121a31;
  --bg-card: #151c33;
  --border: #243056;
  --border-hover: #33427a;
  --text: #e8ecf5;
  --text-body: #c9d0e0;
  --text-muted: #9aa4bd;
  --text-faint: #6f7a94;
  --accent: #7fa7ff;
  --accent-strong: #4d7cff;
  --accent-hover: #3d6bf0;
  --tint: rgba(77, 124, 255, 0.15);
  --header-bg: rgba(11, 16, 32, 0.85);
  --header-border: rgba(36, 48, 86, 0.6);
  --ok-text: #8ee0b5;
  --ok-bg: rgba(46, 160, 103, 0.12);
  --ok-border: rgba(46, 160, 103, 0.35);
  --ok-dot: #3ccf8e;
  --anim: 127, 167, 255;
  --radius: 14px;
  --max: 1040px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-raised: #eef2fa;
  --bg-card: #ffffff;
  --border: #dde3f0;
  --border-hover: #b9c6e4;
  --text: #0f1630;
  --text-body: #333d57;
  --text-muted: #5b6684;
  --text-faint: #7c869f;
  --accent: #2f5fe8;
  --accent-strong: #3b66f5;
  --accent-hover: #2c55d9;
  --tint: rgba(59, 102, 245, 0.1);
  --header-bg: rgba(246, 248, 252, 0.85);
  --header-border: rgba(15, 22, 48, 0.08);
  --ok-text: #137a4b;
  --ok-bg: rgba(46, 160, 103, 0.1);
  --ok-border: rgba(46, 160, 103, 0.3);
  --ok-dot: #1fa866;
  --anim: 59, 102, 245;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  transition: background-color 0.25s, color 0.25s;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--header-border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text-muted);
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
}
.nav a:hover { color: var(--text); background: var(--bg-raised); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); }
.nav .icon-link { display: inline-flex; padding: 8px; }
.nav svg { width: 18px; height: 18px; fill: currentColor; }

/* Hero */
.hero { padding: 88px 0 56px; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; }
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  max-width: 880px;
  margin: 0 auto 18px;
}
.lead { color: var(--text-muted); font-size: 19px; max-width: 600px; margin: 0 auto; }

/* Pool card */
.pool-card {
  max-width: 900px;
  margin: 48px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: left;
}
.pool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ticker { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: 0.04em; }
.ticker small { display: block; font-family: var(--font); font-size: 14px; font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ok-text);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  padding: 4px 12px; border-radius: 999px;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok-dot); }

.pool-id {
  margin-top: 20px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 10px 14px;
}
.pool-id code {
  flex: 1; min-width: 0;
  font-size: 13px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.stat { background: var(--bg-raised); border-radius: 10px; padding: 14px; }
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-top: 2px; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stats[hidden] { display: none; }

.pool-foot { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); }

/* Sections */
section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 10px; }
.section-head p { color: var(--text-muted); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint); color: var(--accent);
  font-family: var(--font-display); font-weight: 700;
  margin-bottom: 16px;
}
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--text-muted); margin: 0; font-size: 16px; }

.note {
  margin-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

.cta { text-align: center; background: var(--bg-raised); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cta h2 { font-size: clamp(26px, 3.5vw, 34px); margin-bottom: 10px; }
.cta p { color: var(--text-muted); margin: 0 0 24px; }

/* About */
.prose { max-width: 680px; margin: 0 auto; }
.prose h2 { font-size: 26px; margin: 40px 0 12px; }
.prose p { color: var(--text-body); margin: 0 0 16px; }
.prose blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent-strong);
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0 16px; padding: 0; list-style: none; }
.facts li { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; color: var(--text-body); font-size: 15px; }

/* Footer */
.site-footer { padding: 40px 0 48px; color: var(--text-muted); font-size: 14px; }
.site-footer .wrap { display: grid; gap: 16px; }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.disclaimer { font-size: 12.5px; line-height: 1.6; color: var(--text-faint); margin: 0; }

@media (max-width: 560px) {
  .hero { padding-top: 56px; }
  .pool-card { padding: 20px; }
  .nav a { padding: 8px; }
}

/* Brand name */
.brand-sub { font-weight: 600; color: var(--text-muted); letter-spacing: 0.02em; }

/* Testimonials */
.testimonials { padding-top: 24px; }
.tweets { columns: 3 280px; column-gap: 16px; }
.tweet {
  break-inside: avoid;
  margin: 0 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s, transform 0.2s;
}
.tweet:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.tweet blockquote { margin: 0 0 18px; font-size: 16px; line-height: 1.6; color: var(--text-body); }
.tweet .tag { color: var(--accent); }
.tweet figcaption a { display: flex; align-items: center; gap: 12px; color: var(--text); }
.tweet figcaption a:hover { text-decoration: none; }
.tweet figcaption a:hover strong { text-decoration: underline; }
.tweet strong { display: block; font-size: 15px; }
.tweet small { display: block; font-size: 13px; color: var(--text-muted); }
.avatar {
  flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint); color: var(--accent);
  font-family: var(--font-display); font-weight: 700;
}

/* Hero blockchain animation */
.hero { position: relative; overflow: hidden; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  /* mask-image is set per animation by animations.js */
}

@media (max-width: 560px) {
  .brand { font-size: 15px; gap: 8px; letter-spacing: 0.02em; }
  .nav a { padding: 8px 6px; font-size: 14px; }
  .brand-mark { width: 30px; height: 30px; }
  .nav { gap: 0; }
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-left: 4px;
  border: 1px solid var(--border); border-radius: 50%;
  background: transparent; color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .brand-mark { box-shadow: 0 0 0 1px var(--border); }

/* Pool card (explorer-style header, live position, economics) */
.pool-ident { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pool-logo { width: 56px; height: 56px; border-radius: 50%; background: #fff; padding: 4px; flex: none; box-shadow: 0 0 0 1px var(--border); }
.pool-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pool-title .ticker { font-size: 28px; }
.pool-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--text-muted); }
.pool-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; color: var(--text-muted); }
.pool-actions { display: flex; gap: 8px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pool-id-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); flex: none; }
.pool-id code { color: var(--accent); }
.stat-group { margin-top: 22px; }
.group-label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.stat-group .stats { margin-top: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-value { font-variant-numeric: tabular-nums; }
#stats[hidden] { display: none; }

@media (max-width: 760px) {
  .stat-group .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-actions { width: 100%; }
  .pool-actions .btn-primary { flex: 1; }
}
@media (max-width: 560px) {
  .pool-logo { width: 44px; height: 44px; }
  .pool-title .ticker { font-size: 24px; }
  .pool-name { font-size: 15px; }
  .pool-id-label { display: none; }
  .nav-home { display: none; }          /* the logo already links home */
  .theme-toggle { width: 32px; height: 32px; }
  .pool-ident { align-items: flex-start; gap: 12px; }
  .pool-title { gap: 2px 10px; }
}

/* Combined fees */
.fees {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px 16px;
  background: var(--bg-raised);
  border-radius: 10px;
  padding: 16px 18px;
}
.fee-part .stat-value { font-size: 26px; margin: 0 0 2px; }
.fee-plus { font-family: var(--font-display); font-size: 22px; color: var(--text-muted); }
.fee-note {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.fee-note strong { color: var(--text); font-weight: 600; }
@media (max-width: 560px) {
  .fees { grid-template-columns: 1fr; }
  .fee-plus { display: none; }
}

/* Recent blocks timeline */
.blocks-card { margin-top: 16px; }
.blocks-card[hidden] { display: none; }
.blocks-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.blocks-head .group-label { margin-bottom: 4px; }
.blocks-summary { font-size: 15px; color: var(--text-muted); }
.blocks-summary strong { color: var(--text); font-weight: 600; }
.epoch-progress { min-width: 200px; text-align: right; }
.epoch-bar { height: 6px; border-radius: 999px; background: var(--bg-raised); overflow: hidden; }
.epoch-bar span { display: block; height: 100%; width: 0; background: var(--accent-strong); border-radius: inherit; transition: width 0.6s; }
.epoch-progress small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }

.timeline {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px;
  position: relative;
}
.timeline::before {           /* the chain link running through the blocks */
  content: ""; position: absolute; left: 8%; right: 8%; top: 22px;
  border-top: 1px dashed var(--border-hover);
}
.timeline li { position: relative; }
.timeline a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; color: var(--text); padding: 4px 2px;
  border-radius: 10px;
}
.timeline a:hover { text-decoration: none; background: var(--bg-raised); }
.block-icon {
  width: 36px; height: 36px; margin-bottom: 8px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 8px;
  background: var(--bg-card); border: 1px solid var(--border-hover); border-radius: 8px;
  position: relative; z-index: 1;
}
.block-icon i { display: block; height: 2px; border-radius: 2px; background: var(--accent); opacity: 0.6; }
.block-icon i:last-child { width: 55%; }
.latest .block-icon { background: var(--accent-strong); border-color: var(--accent-strong); box-shadow: 0 0 0 5px var(--tint); }
.latest .block-icon i { background: #fff; opacity: 0.9; }
.block-height { font-family: var(--font-display); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.block-ago { font-size: 13px; color: var(--text-muted); }
.latest .block-ago { color: var(--accent); }
.block-epoch { font-size: 12px; color: var(--text-faint); }

@media (max-width: 760px) {
  .timeline { display: flex; flex-direction: column-reverse; gap: 0; }   /* newest on top */
  .timeline::before { left: 18px; right: auto; top: 18px; bottom: 18px; border-top: 0; border-left: 1px dashed var(--border-hover); }
  .timeline a { flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; padding: 6px 0; }
  .block-icon { margin-bottom: 0; flex: none; }
  .block-height { min-width: 0; }
  .block-ago { margin-left: auto; white-space: nowrap; }
  .block-epoch { display: none; }   /* shown in the card heading instead */
  .epoch-progress { width: 100%; min-width: 0; text-align: left; }
}

/* FAQ */
.faq-section { padding-top: 24px; }
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq .more { display: grid; gap: 10px; }
.faq .more[hidden] { display: none; }
.faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.faq details:hover, .faq details[open] { border-color: var(--border-hover); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 20px;
  font-weight: 600; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint); color: var(--accent);
  font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1;
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--text-body); font-size: 15.5px; line-height: 1.65; }
.faq-toggle { display: block; margin: 20px auto 0; }
#faq { scroll-margin-top: 72px; }

@media (max-width: 420px) {
  .nav .icon-link { display: none; }   /* X is still linked in the hero CTA and footer */
}

/* Newest delegators */
.deleg-card { margin-top: 16px; }
.deleg-card[hidden] { display: none; }
.deleg-list {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px;
}
.deleg-list li { border-top: 1px solid var(--border); }
.deleg-list li:nth-child(-n+2) { border-top: 0; }
.deleg-list a {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto;
  column-gap: 12px; align-items: center;
  padding: 10px 6px; color: var(--text); border-radius: 8px;
}
.deleg-list a:hover { text-decoration: none; background: var(--bg-raised); }
.deleg-dot {
  grid-row: 1 / -1; width: 30px; height: 30px; border-radius: 50%;
  background: var(--tint); position: relative;
}
.deleg-dot::after {   /* a little "wallet joined" check-in pip */
  content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--accent); opacity: 0.7;
}
.is-new .deleg-dot { background: var(--ok-bg); }
.is-new .deleg-dot::after { background: var(--ok-dot); opacity: 1; }
.deleg-addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.deleg-amt { font-family: var(--font-display); font-weight: 600; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.deleg-when { grid-column: 2 / 4; font-size: 12.5px; color: var(--text-muted); }
.is-new .deleg-when { color: var(--ok-text); }

@media (max-width: 760px) {
  .deleg-list { grid-template-columns: 1fr; }
  .deleg-list li:nth-child(2) { border-top: 1px solid var(--border); }
}

/* Hero proof points */
.proof {
  list-style: none; margin: 28px auto 0; padding: 0;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 28px;
  max-width: 760px;
}
.proof li { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; }
.proof strong { font-family: var(--font-display); font-size: 16px; color: var(--text); }
.proof li > span { color: var(--text-muted); }
@media (max-width: 560px) {
  .proof { gap: 14px; }
  .proof li { flex: 1 1 100%; }
}
