/* riecoin.net — community guide. System fonts only, no external requests. */
:root {
  color-scheme: light dark;
  --bg: #fbfaf6;
  --panel: #ffffff;
  --alt: #f2f0ea;
  --text: #171a22;
  --muted: #5a6070;
  --line: #e1ddd2;
  --accent: #2f3aa8;
  --accent-ink: #ffffff;
  --accent-soft: #e6e8fb;
  --prime: #b45309;
  --prime-bg: #fdecc8;
  --hero-a: #1b2166;
  --hero-b: #2f3aa8;
  --hero-ink: #ffffff;
  --hero-muted: #cfd3f5;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 8px 24px rgba(20, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --panel: #171a23;
    --alt: #131620;
    --text: #e8eaf1;
    --muted: #a0a6b8;
    --line: #2a2f3d;
    --accent: #8f99ff;
    --accent-ink: #0f1117;
    --accent-soft: #232848;
    --prime: #f2b45a;
    --prime-bg: #3a2a10;
    --hero-a: #10133a;
    --hero-b: #232a7a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-text-size-adjust: 100%; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--accent); }
a:focus-visible, summary:focus-visible, .btn:focus-visible { outline: 3px solid var(--prime); outline-offset: 2px; border-radius: 4px; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace; font-size: .9em; background: var(--alt); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); font-size: .9375rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); color: var(--text); padding: 8px 12px; border-radius: 6px; z-index: 20; }
.skip:focus { left: 8px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.mark { width: 30px; height: 30px; fill: var(--accent); }
.mark .gap { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .55; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: .9375rem; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { color: var(--text); background: var(--alt); }

.btn { display: inline-block; font: inherit; font-weight: 600; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 18px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 7px 14px; font-size: .9375rem; border-radius: 8px; }

/* Hero */
.hero { background: linear-gradient(140deg, var(--hero-a), var(--hero-b)); color: var(--hero-ink); padding: 72px 0 96px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
.eyebrow { font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--hero-muted); margin-bottom: 14px; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; }
.lead { margin-top: 18px; font-size: 1.125rem; color: var(--hero-muted); max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .btn { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.hero .btn:hover { border-color: #fff; }
.hero .btn.primary { background: #fff; border-color: #fff; color: #1b2166; }

.tuple { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 22px; }
.line { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.line li { text-align: center; font: 600 .9375rem/1 ui-monospace, "Cascadia Code", Consolas, Menlo, monospace; padding: 11px 0; border-radius: 8px; color: rgba(255, 255, 255, .42); background: rgba(255, 255, 255, .04); }
.line li.p { color: #2a1a02; background: #f6c667; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.tuple figcaption { margin-top: 16px; font-size: .9375rem; color: var(--hero-muted); }
.tuple figcaption b { color: #fff; }

/* Figures strip */
.strip { margin-top: -44px; position: relative; }
.figures { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); max-width: 1072px; padding: 0; }
.figures > div { padding: 18px 20px; border-left: 1px solid var(--line); }
.figures > div:first-child { border-left: 0; }
.k { font-size: .8125rem; color: var(--muted); }
.v { font-size: 1.375rem; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; }
.live { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: .9375rem; color: var(--muted); max-width: 1072px; }
.live[hidden] { display: none; }
.live b { color: var(--text); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; flex: none; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--alt); border-block: 1px solid var(--line); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); letter-spacing: -.02em; line-height: 1.2; }
h3 { font-size: 1.0625rem; letter-spacing: -.005em; }
.intro { margin-top: 10px; max-width: 44rem; color: var(--muted); font-size: 1.0625rem; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.card p { margin-top: 8px; color: var(--muted); }

.steps { counter-reset: step; margin-top: 28px; display: grid; gap: 22px; }
.steps li { counter-increment: step; position: relative; padding-left: 52px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.steps p { margin-top: 4px; color: var(--muted); }

.explain { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.pattern { display: grid; gap: 6px; font: .9375rem/1.5 ui-monospace, "Cascadia Code", Consolas, Menlo, monospace; background: var(--prime-bg); color: var(--text); border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: nowrap; }
.pattern b { color: var(--prime); }

.path { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
.stage .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
.stage > p:not(.n) { color: var(--muted); }
.link { font-weight: 600; }

.pools { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 28px; }
.pools .muted { margin-top: 6px; max-width: 44rem; }
.pools ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.pools li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 2px; }
.pools li a { font-weight: 600; }
.pools li span { color: var(--muted); font-size: .875rem; }

.table-scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 14px 18px 0; font-weight: 600; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .8125rem; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; }
tr.now td { background: var(--accent-soft); font-weight: 600; }
.pill { display: inline-block; margin-left: 6px; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); vertical-align: 1px; }

.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.links a { display: grid; gap: 2px; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.links a:hover { border-color: var(--accent); }
.links b { color: var(--text); }
.links span { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { margin-top: 20px; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; padding: 16px 28px 16px 0; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.375rem; font-weight: 400; color: var(--muted); }
details[open] summary::after { content: "–"; }
details p { padding: 0 0 18px; color: var(--muted); max-width: 42rem; }

.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: .9375rem; color: var(--muted); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.foot b { color: var(--text); }

/* Narrow screens */
@media (max-width: 960px) {
  .hero-grid, .two { grid-template-columns: 1fr; gap: 36px; }
  .cards, .path, .pools ul, .links { grid-template-columns: 1fr 1fr; }
  .figures { grid-template-columns: repeat(3, 1fr); }
  .figures > div:nth-child(4) { border-left: 0; }
  .figures > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .nav { display: none; }
  .top-row .btn { margin-left: auto; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 76px; }
  .section { padding: 52px 0; }
  .cards, .path, .pools ul, .links { grid-template-columns: 1fr; }
  .figures { grid-template-columns: 1fr 1fr; margin: 0 16px; }
  .figures > div { border-left: 0; border-top: 1px solid var(--line); padding: 14px 16px; }
  .figures > div:nth-child(-n+2) { border-top: 0; }
  .figures > div:nth-child(even) { border-left: 1px solid var(--line); }
  .figures > div:last-child { grid-column: 1 / -1; border-left: 0; }
  .line { gap: 4px; }
  .line li { font-size: .8125rem; padding: 9px 0; }
  .tuple { padding: 16px; }
  .live { align-items: flex-start; }
  .live .dot { margin-top: 8px; }
}
.hero-grid > *, .two > *, .cards > *, .path > *, .links > * { min-width: 0; }
