/* ==========================================================================
   RaiblocksOne — site styles
   Plain CSS, no build step. Loaded by every page.
   ========================================================================== */

/* --- tokens ------------------------------------------------------------- */

:root {
  --bg:            #0e0e13;
  --bg-soft:       #14141b;
  --surface:       #16161e;
  --surface-2:     #1c1c26;
  --border:        #282833;
  --border-strong: #3a3a49;

  --text:          #e9e9f0;
  --text-dim:      #a4a4b6;
  --text-faint:    #74748a;

  --accent:        #5b9dff;
  --accent-soft:   rgba(91, 157, 255, .12);
  --accent-line:   rgba(91, 157, 255, .35);

  --ok:            #4ade80;
  --ok-soft:       rgba(74, 222, 128, .10);
  --warn:          #fbbf24;
  --warn-soft:     rgba(251, 191, 36, .10);
  --danger:        #f87171;
  --danger-soft:   rgba(248, 113, 113, .10);

  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --wrap: 1120px;
  --wrap-narrow: 760px;
  --radius: 14px;
  --radius-sm: 9px;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.28);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

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

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

img { max-width: 100%; height: auto; vertical-align: middle; }

/* Every SVG here is an inline icon. Without this, one that no component rule
   happens to size falls back to the replaced-element default of 300x150 and
   wrecks the layout. Component rules below override it on specificity. */
svg { width: 1em; height: 1em; flex: none; }

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: #06060a;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* --- layout ------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 22px;
}
.wrap--narrow { max-width: var(--wrap-narrow); }

section { position: relative; }

.section { padding: 68px 0; }
.section--tight { padding: 44px 0; }
.section--alt { background: var(--bg-soft); border-block: 1px solid var(--border); }

/* --- typography --------------------------------------------------------- */

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--text-dim);
  line-height: 1.6;
  font-weight: 300;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: .9rem; }

.section-head { max-width: 720px; margin-bottom: 34px; }
.section-head.center { margin-inline: auto; text-align: center; }

code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .12em .38em;
  overflow-wrap: anywhere;
}

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

/* --- header / nav ------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 14, 19, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.06rem;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: auto; }
.brand span { color: var(--text); }

.nav-spacer { flex: 1; }

.nav-links ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: .875rem;
  font-weight: 500;
  transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.nav-links a.ext::after {
  content: "";
  display: inline-block;
  width: .58em; height: .58em;
  margin-left: .42em;
  vertical-align: .04em;
  opacity: .5;
  background: currentColor;
  -webkit-mask: var(--ext-icon) no-repeat center / contain;
  mask: var(--ext-icon) no-repeat center / contain;
  --ext-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .18s, border-color .18s;
}
.nav-cta:hover { background: rgba(91,157,255,.2); border-color: var(--accent); text-decoration: none; }
.nav-cta svg { width: 15px; height: 15px; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { width: 19px; height: 19px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .nav-spacer { display: none; }
  .brand { margin-right: auto; }

  .nav-links {
    position: fixed;
    inset: 66px 0 auto 0;
    max-height: calc(100dvh - 66px);
    overflow-y: auto;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 10px 22px 22px;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav-links[data-open="true"] { display: block; }
  .nav-links ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-links a { padding: 12px 12px; font-size: .97rem; }
  .nav-cta { margin-top: 10px; justify-content: center; padding: 12px 15px; font-size: .92rem; }
}

/* --- hero --------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(64px, 11vw, 118px) 0 clamp(56px, 8vw, 86px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 130%;
  background:
    radial-gradient(52% 46% at 22% 8%,  rgba(91,157,255,.16), transparent 68%),
    radial-gradient(44% 42% at 82% 22%, rgba(74,222,128,.09), transparent 70%);
  pointer-events: none;
}

.hero > * { position: relative; }

.hero h1 { max-width: 15ch; }
.hero .lede { max-width: 58ch; margin-top: 6px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: .94rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s, background .16s, border-color .16s;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: #23232f;
}
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06060d;
}
.btn--primary:hover { background: #7bb0ff; border-color: #7bb0ff; }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }

.btn svg { width: 17px; height: 17px; flex: none; }

/* --- cards / grid ------------------------------------------------------- */

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

a.card { color: inherit; transition: border-color .18s, background .18s, transform .18s; }
a.card:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.card h3 { margin-bottom: .38em; }
.card p { color: var(--text-dim); font-size: .95rem; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}
.card-icon svg { width: 20px; height: 20px; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--accent);
}
.card-link svg { width: 14px; height: 14px; }

/* --- stats -------------------------------------------------------------- */

.stat {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat dt {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.stat dd {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat .stat-note { display: block; margin-top: 5px; font-size: .82rem; font-weight: 400; color: var(--text-dim); letter-spacing: 0; }

/* --- badges ------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  background: var(--surface-2);
  white-space: nowrap;
}
.badge--ok     { color: var(--ok);     border-color: rgba(74,222,128,.35);  background: var(--ok-soft); }
.badge--warn   { color: var(--warn);   border-color: rgba(251,191,36,.35);  background: var(--warn-soft); }
.badge--danger { color: var(--danger); border-color: rgba(248,113,113,.35); background: var(--danger-soft); }
.badge--accent { color: var(--accent); border-color: var(--accent-line);    background: var(--accent-soft); }

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* --- callouts ----------------------------------------------------------- */

.callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.callout h4 { margin-bottom: .3em; font-size: .97rem; }
.callout p { font-size: .94rem; color: var(--text-dim); }
.callout > svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--text-faint); }
.callout > div { min-width: 0; }

.callout--danger { border-left-color: var(--danger); background: var(--danger-soft); }
.callout--danger > svg, .callout--danger h4 { color: var(--danger); }
.callout--warn   { border-left-color: var(--warn);   background: var(--warn-soft); }
.callout--warn > svg,   .callout--warn h4   { color: var(--warn); }
.callout--ok     { border-left-color: var(--ok);     background: var(--ok-soft); }
.callout--ok > svg,     .callout--ok h4     { color: var(--ok); }
.callout--info   { border-left-color: var(--accent); background: var(--accent-soft); }
.callout--info > svg,   .callout--info h4   { color: var(--accent); }

/* --- code blocks -------------------------------------------------------- */

.code {
  position: relative;
  margin: 20px 0;
  background: #0b0b11;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-faint);
  font-family: var(--mono);
}
.code-head .code-label { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.7;
  color: #d5d5e2;
  tab-size: 2;
}
.code pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s, border-color .18s;
  flex: none;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn[data-copied="true"] { color: var(--ok); border-color: rgba(74,222,128,.4); }
.copy-btn svg { width: 13px; height: 13px; }

.code--legacy { opacity: .62; }
.code--legacy pre { color: var(--text-dim); }

/* --- steps -------------------------------------------------------------- */

.steps { counter-reset: step; margin: 30px 0 0; padding: 0; list-style: none; }

.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 34px 52px;
  border-left: 1px solid var(--border);
  margin-left: 15px;
}
.step:last-child { border-left-color: transparent; padding-bottom: 4px; }

.step::before {
  content: counter(step);
  position: absolute;
  left: -16px;
  top: -2px;
  width: 31px; height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-size: .82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.step > h3 { margin-top: 0; padding-top: 2px; }
.step > p { color: var(--text-dim); font-size: .95rem; }

@media (max-width: 560px) {
  .step { padding-left: 34px; margin-left: 14px; }
}

/* --- tables ------------------------------------------------------------- */

.table-scroll { overflow-x: auto; margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }

table { width: 100%; border-collapse: collapse; font-size: .91rem; }

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--surface);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* --- prose (whitepaper, long-form) -------------------------------------- */

.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.1em; padding-top: .3em; }
.prose h3 { margin-top: 1.7em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { color: var(--text-dim); }
.prose ul, .prose ol { color: var(--text-dim); padding-left: 1.3em; margin: 0 0 1.05em; }
.prose li { margin-bottom: .45em; }
.prose strong { color: var(--text); font-weight: 600; }

.prose-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}
@media (max-width: 900px) {
  .prose-layout { grid-template-columns: 1fr; gap: 30px; }
}

.toc {
  position: sticky;
  top: 88px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
}
.toc h4 {
  margin-bottom: .8em;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 3px; }
.toc li.sub { padding-left: 14px; }
.toc a { display: block; padding: 4px 0; color: var(--text-dim); line-height: 1.4; }
.toc a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 900px) {
  .toc { position: static; }
}

/* --- accordion (FAQ) ---------------------------------------------------- */

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-item > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  transition: background .18s;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { background: var(--surface-2); }
.faq-item > summary::after {
  content: "";
  margin-left: auto;
  width: 10px; height: 10px;
  flex: none;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .22s;
}
.faq-item[open] > summary::after { transform: rotate(-135deg) translate(-3px, -3px); }

.faq-body { padding: 0 20px 20px; color: var(--text-dim); font-size: .95rem; }
.faq-body > *:first-child { margin-top: 0; }

/* --- timeline (roadmap) ------------------------------------------------- */

.timeline { margin: 0; padding: 0; list-style: none; }

.tl-item {
  position: relative;
  padding: 0 0 30px 34px;
  border-left: 1px solid var(--border);
  margin-left: 7px;
}
.tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -6px; top: 7px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
}
.tl-item.done::before   { background: var(--ok);     border-color: var(--ok); }
.tl-item.active::before { background: var(--accent); border-color: var(--accent); }

.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: .35em; }
.tl-head h3 { margin: 0; }
.tl-item p { color: var(--text-dim); font-size: .95rem; }

/* --- link list ---------------------------------------------------------- */

.link-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  margin-bottom: 10px;
  transition: border-color .18s, background .18s;
}
.link-row:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); }
.link-row .lr-icon { color: var(--accent); flex: none; display: grid; place-items: center; }
.link-row .lr-icon svg { width: 20px; height: 20px; }
.link-row strong { display: block; font-size: .97rem; }
.link-row span { display: block; font-size: .87rem; color: var(--text-dim); }
.link-row .lr-arrow { margin-left: auto; color: var(--text-faint); flex: none; }
.link-row .lr-arrow svg { width: 16px; height: 16px; }

/* --- footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 52px 0 34px;
  font-size: .9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 38px;
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 28px; }
}

.footer-brand p { margin-top: 12px; color: var(--text-dim); font-size: .89rem; max-width: 34ch; }

.footer-col h4 {
  margin-bottom: 12px;
  font-size: .73rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-dim); }
.footer-col a:hover { color: var(--text); text-decoration: none; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: .85rem;
}
.footer-bottom .spacer { flex: 1; }

/* --- utilities ---------------------------------------------------------- */

.mt-0  { margin-top: 0; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mb-0  { margin-bottom: 0; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
