/* ==========================================================================
   ETH On Chain shared layer
   Used by EVERY page: design tokens, header, live ticker, footer, buttons.
   All classes are prefixed rk- so they cannot collide with Bootstrap or the
   template's app.css on the inner pages. Theme is driven by switchmode.js
   (body.is_light / body.is_dark, "theme" cookie, dark by default).
   ========================================================================== */

:root {
  --rk-bg: #ffffff;
  --rk-soft: #f4f6fa;
  --rk-ink: #0e1627;
  --rk-muted: #566074;
  --rk-line: #e3e7ef;
  --rk-primary: #2d63f0;
  --rk-primary-hover: #2150d1;
  --rk-on-primary: #ffffff;
  --rk-pos: #0b7f52;
  --rk-neg: #c93434;
  --rk-cta-bg: #0e1627;
  --rk-cta-ink: #ffffff;
  --rk-cta-muted: #aab4c8;
  --rk-header-bg: rgba(255, 255, 255, 0.86);
  --rk-shadow: 0 1px 2px rgba(14, 22, 39, 0.04), 0 24px 48px -16px rgba(14, 22, 39, 0.18);

  --rk-font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --rk-r-sm: 10px;
  --rk-r-md: 14px;
  --rk-r-lg: 24px;
  --rk-r-xl: 32px;

  --rk-wrap: 1200px;
  --rk-gutter: clamp(20px, 4vw, 40px);
  --rk-header-h: 72px;
}

body.is_dark {
  --rk-bg: #0a0e17;
  --rk-soft: #111826;
  --rk-ink: #eef1f7;
  --rk-muted: #98a3b9;
  --rk-line: #1f2839;
  --rk-primary: #3f6bf2;
  --rk-primary-hover: #5a82ff;
  --rk-pos: #2fd08b;
  --rk-neg: #ff7070;
  --rk-cta-bg: #111826;
  --rk-cta-ink: #eef1f7;
  --rk-cta-muted: #98a3b9;
  --rk-header-bg: rgba(10, 14, 23, 0.86);
  --rk-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -16px rgba(0, 0, 0, 0.6);
}

/* ---------- Small shared helpers ---------- */
.rk-wrap { width: 100%; max-width: calc(var(--rk-wrap) + var(--rk-gutter) * 2); margin: 0 auto; padding: 0 var(--rk-gutter); box-sizing: border-box; }
.rk-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rk-num { font-variant-numeric: tabular-nums; }
.rk-up { color: var(--rk-pos); }
.rk-down { color: var(--rk-neg); }

.rk-skip {
  position: absolute; left: 16px; top: -64px; z-index: 10000;
  background: var(--rk-ink); color: var(--rk-bg); padding: 10px 16px; border-radius: var(--rk-r-sm);
  font: 500 0.9375rem/1 var(--rk-font); text-decoration: none; transition: top 0.2s;
}
.rk-skip:focus { top: 12px; }

.rk-header :focus-visible, .rk-footer :focus-visible, .rk-ticker :focus-visible, .rk-btn:focus-visible {
  outline: 2px solid var(--rk-primary); outline-offset: 3px; border-radius: 6px;
}

/* ---------- Buttons ---------- */
.rk-btn {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  height: 48px; padding: 0 22px; margin: 0;
  border: 1px solid transparent; border-radius: var(--rk-r-sm);
  font: 500 0.9375rem/1 var(--rk-font); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rk-btn-primary { background: var(--rk-primary); color: var(--rk-on-primary); }
.rk-btn-primary:hover { background: var(--rk-primary-hover); color: var(--rk-on-primary); }
.rk-btn-soft { background: var(--rk-soft); color: var(--rk-ink); border-color: var(--rk-line); }
.rk-btn-soft:hover { border-color: var(--rk-muted); color: var(--rk-ink); }
.rk-btn-line { background: transparent; color: var(--rk-ink); border-color: var(--rk-line); }
.rk-btn-line:hover { border-color: var(--rk-ink); color: var(--rk-ink); }
.rk-btn-sm { height: 36px; padding: 0 14px; font-size: 0.875rem; border-radius: 9px; }

/* ---------- Header ---------- */
.rk-header {
  position: sticky; top: 0; z-index: 9999; box-sizing: border-box;
  height: var(--rk-header-h); width: 100%;
  background: var(--rk-header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s ease;
  font-family: var(--rk-font);
}
.rk-header.is-scrolled { border-bottom-color: var(--rk-line); }
.rk-header-row { height: 100%; display: flex; align-items: center; gap: 40px; }

.rk-brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.rk-brand img { display: block; width: 167px; height: 32px; max-width: none; }
.rk-brand .rk-logo-dark { display: none; }
body.is_dark .rk-brand .rk-logo-light { display: none; }
body.is_dark .rk-brand .rk-logo-dark { display: block; }

.rk-nav { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.rk-nav a {
  display: block; padding: 8px 14px; border-radius: 9px; text-decoration: none;
  font: 500 0.9375rem/1.4 var(--rk-font); color: var(--rk-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.rk-nav a:hover, .rk-nav a[aria-current="page"] { color: var(--rk-ink); }
.rk-nav a:hover { background: var(--rk-soft); }

.rk-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.rk-login {
  display: block; padding: 8px 14px; border-radius: 9px; text-decoration: none;
  font: 500 0.9375rem/1.4 var(--rk-font); color: var(--rk-ink);
}
.rk-login:hover { background: var(--rk-soft); color: var(--rk-ink); }

.rk-icon-btn {
  width: 40px; height: 40px; padding: 0; margin: 0; display: inline-grid; place-items: center;
  background: transparent; border: 0; border-radius: 10px; cursor: pointer; color: var(--rk-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.rk-icon-btn:hover { color: var(--rk-ink); background: var(--rk-soft); }
.rk-icon-btn svg { width: 20px; height: 20px; display: block; }
.rk-theme .i-moon { display: none; }
body.is_dark .rk-theme .i-sun { display: none; }
body.is_dark .rk-theme .i-moon { display: block; }
.rk-menu-btn { display: none; }
.rk-menu-btn .i-close { display: none; }
.rk-menu-btn[aria-expanded="true"] .i-open { display: none; }
.rk-menu-btn[aria-expanded="true"] .i-close { display: block; }

/* ---------- Ticker tape (real prices only; hidden until data arrives) ---------- */
.rk-ticker {
  height: 44px; overflow: hidden; box-sizing: border-box;
  background: var(--rk-bg); border-bottom: 1px solid var(--rk-line);
  font-family: var(--rk-font);
}
.rk-ticker[hidden] { display: none; }
.rk-ticker-track { display: flex; width: max-content; height: 100%; animation: rk-scroll var(--rk-dur, 80s) linear infinite; }
.rk-ticker:hover .rk-ticker-track, .rk-ticker:focus-within .rk-ticker-track { animation-play-state: paused; }
.rk-ticker-group { display: flex; flex: none; }
.rk-tick {
  display: flex; align-items: center; gap: 8px; padding: 0 22px; height: 100%;
  font-size: 0.8125rem; color: var(--rk-muted); text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease;
}
.rk-tick:hover { background: var(--rk-soft); color: var(--rk-muted); }
.rk-tick img { width: 18px; height: 18px; border-radius: 50%; display: block; }
.rk-tick b { font-weight: 500; color: var(--rk-ink); }
@keyframes rk-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .rk-ticker { overflow-x: auto; }
  .rk-ticker-track { animation: none; }
  .rk-ticker-group[aria-hidden="true"] { display: none; }
}

/* ---------- Footer ---------- */
.rk-footer { padding: clamp(56px, 7vw, 96px) 0 40px; font-family: var(--rk-font); background: var(--rk-bg); color: var(--rk-muted); box-sizing: border-box; }
.rk-footer * { box-sizing: border-box; }
.rk-footer-grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2fr)); gap: 40px; }
.rk-footer-brand p { margin: 16px 0 0; max-width: 28ch; color: var(--rk-muted); font-size: 0.9375rem; line-height: 1.55; }
.rk-footer h3 { margin: 0 0 14px; font: 500 0.875rem/1.4 var(--rk-font); color: var(--rk-ink); }
.rk-footer nav a { display: block; padding: 5px 0; color: var(--rk-muted); font-size: 0.9375rem; text-decoration: none; transition: color 0.15s ease; }
.rk-footer nav a:hover { color: var(--rk-ink); }
.rk-footer-base { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rk-line); display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; font-size: 0.8125rem; line-height: 1.55; }
.rk-footer-base p { margin: 0; max-width: 70ch; }

/* ---------- Responsive chrome ---------- */
@media (max-width: 1023px) {
  .rk-header-row { gap: 12px; }
  .rk-menu-btn { display: inline-grid; }
  .rk-login { display: none; }
  .rk-nav {
    position: absolute; left: 0; right: 0; top: var(--rk-header-h);
    flex-direction: column; align-items: stretch; gap: 2px; display: none;
    background: var(--rk-bg); border-bottom: 1px solid var(--rk-line);
    padding: 8px var(--rk-gutter) 20px;
  }
  .rk-nav.is-open { display: flex; }
  .rk-nav a { padding: 14px 4px; font-size: 1.0625rem; color: var(--rk-ink); border-radius: 0; border-bottom: 1px solid var(--rk-line); }
  .rk-nav a:hover { background: transparent; }
  .rk-footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rk-footer-brand { grid-column: 1 / -1; }
}
@media (min-width: 1024px) { .rk-nav .rk-nav-login { display: none; } }
@media (max-width: 639px) { .rk-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ==========================================================================
   Template bridge: makes the original (app.css) inner pages share the
   ETH On Chain palette and type. Only loaded after app.css on those pages.
   ========================================================================== */
:root { --primary: #2d63f0; --onsurface: #0e1627; --text: #566074; --line: #e3e7ef; --surface: #f4f6fa; --bg: #ffffff; --bg1: #ffffff; }
body.is_dark { --bg: #0a0e17; --bg1: #111826; --surface: #111826; --line: #1f2839; --onsurface: #eef1f7; --text: #98a3b9; --primary: #3f6bf2; }
body.body { font-family: var(--rk-font); background: var(--bg); }
body.body :where(h1, h2, h3, h4, h5, h6, button, input, select, textarea, label) { font-family: var(--rk-font); }
body.body :where(h1, h2, h3, h4, h5, h6) { letter-spacing: -0.02em; }
body.body .section-sale { display: none; } /* removed placeholder promo ("Earn up to $25") */
