/* ==========================================================================
   ETH On Chain landing page (index.html). Tokens, header, footer, ticker and
   buttons come from site.css; this file only holds the page's own sections.
   ========================================================================== */

body.lp {
  margin: 0; font-family: var(--rk-font); font-size: 16px; line-height: 1.55;
  color: var(--rk-ink); background: var(--rk-bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }

:where(.lp h1, .lp h2, .lp h3, .lp p, .lp ul, .lp ol, .lp figure) { margin: 0; padding: 0; }
:where(.lp ul, .lp ol) { list-style: none; }
:where(.lp a) { color: inherit; text-decoration: none; }
:where(.lp img, .lp svg) { display: block; max-width: 100%; }
:where(.lp button, .lp input, .lp select) { font: inherit; color: inherit; }
.lp :focus-visible { outline: 2px solid var(--rk-primary); outline-offset: 3px; border-radius: 6px; }

/* ---------- Type scale ---------- */
.lp-display { font-size: clamp(2.5rem, 5vw, 4.25rem); line-height: 1.03; letter-spacing: -0.042em; font-weight: 500; }
.lp-h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.12; letter-spacing: -0.032em; font-weight: 500; }
.lp-lede { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.5; color: var(--rk-muted); max-width: 34ch; }
.lp-small { font-size: 0.8125rem; color: var(--rk-muted); }
.lp-link { font-weight: 500; font-size: 0.9375rem; color: var(--rk-primary); border-bottom: 1px solid transparent; }
.lp-link:hover { border-bottom-color: currentColor; }

.lp-section { padding: clamp(48px, 7vw, 96px) 0; }
.lp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; flex-wrap: wrap; }
.lp-head p { margin-top: 8px; color: var(--rk-muted); }

/* icomoon coin glyphs from the template */
.lp-coin { display: inline-flex; font-size: 32px; width: 1em; height: 1em; flex: none; }
.lp-coin img { width: 1em; height: 1em; border-radius: 50%; }

/* ---------- Hero ---------- */
.lp-hero { padding: clamp(32px, 5vw, 72px) 0 clamp(24px, 4vw, 48px); }
.lp-hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 4.5vw, 72px); align-items: center; }
.lp-hero-copy .lp-lede { margin-top: 24px; }
.lp-hero-cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }
.lp-hero-note { margin-top: 24px; max-width: 40ch; }

/* ---------- Interactive chart widget ---------- */
.lp-widget {
  background: var(--rk-bg); border: 1px solid var(--rk-line); border-radius: var(--rk-r-lg);
  box-shadow: var(--rk-shadow); padding: 20px 20px 14px; min-width: 0;
}
.lp-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.lp-pill {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rk-line);
  background: transparent; cursor: pointer; font-size: 0.8125rem; font-weight: 500; color: var(--rk-muted);
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.lp-pill:hover { color: var(--rk-ink); border-color: var(--rk-muted); }
.lp-pill[aria-pressed="true"] { background: var(--rk-ink); border-color: var(--rk-ink); color: var(--rk-bg); }

.lp-quote { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.lp-quote-name { font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.lp-quote-name span { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--rk-muted); }
.lp-quote-price { margin-left: auto; text-align: right; line-height: 1.2; min-height: 2.6em; }
.lp-quote-price strong { display: block; font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; }
.lp-quote-price span { font-size: 0.8125rem; font-weight: 500; }

.lp-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 16px; align-items: center; }
.lp-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--rk-soft); border: 1px solid var(--rk-line); }
.lp-seg button {
  height: 28px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font-size: 0.8125rem; font-weight: 500; color: var(--rk-muted); transition: color 0.15s, background-color 0.15s;
}
.lp-seg button:hover { color: var(--rk-ink); }
.lp-seg button[aria-pressed="true"], .lp-seg button[aria-selected="true"] { background: var(--rk-bg); color: var(--rk-ink); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.lp-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.lp-chip {
  height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rk-line); background: transparent;
  cursor: pointer; font-size: 0.75rem; font-weight: 500; color: var(--rk-muted);
  display: inline-flex; align-items: center; gap: 6px; transition: color 0.15s, border-color 0.15s;
}
.lp-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sw, var(--rk-muted)); opacity: 0.35; }
.lp-chip:hover { color: var(--rk-ink); border-color: var(--rk-muted); }
.lp-chip[aria-pressed="true"] { color: var(--rk-ink); border-color: var(--sw, var(--rk-ink)); }
.lp-chip[aria-pressed="true"]::before { opacity: 1; }
.lp-chip:disabled { opacity: 0.4; cursor: not-allowed; }

.lp-chartbox { position: relative; margin-top: 14px; min-height: 340px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.lp-chartbox svg { width: 100%; display: block; overflow: visible; }
.lp-chartbox .g-line { stroke: var(--rk-line); stroke-width: 1; stroke-dasharray: 3 5; }
.lp-chartbox .g-axis { fill: var(--rk-muted); font: 400 11px var(--rk-font); }
.lp-chartbox .price-line { fill: none; stroke: var(--rk-primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lp-chartbox .price-area { fill: url(#lp-fade); }
.lp-chartbox .cross { stroke: var(--rk-muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.lp-chartbox .cross-dot { fill: var(--rk-primary); stroke: var(--rk-bg); stroke-width: 2; pointer-events: none; }
.lp-chartbox.is-intro svg { animation: lp-reveal 1.3s cubic-bezier(0.3, 0.6, 0.2, 1) backwards; }
@keyframes lp-reveal { from { clip-path: inset(-8px 100% -8px -8px); } to { clip-path: inset(-8px -8px -8px -8px); } }

.lp-state {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
  text-align: center; color: var(--rk-muted); font-size: 0.9375rem; padding: 24px;
  background: color-mix(in srgb, var(--rk-bg) 78%, transparent); border-radius: var(--rk-r-md);
}
.lp-state[hidden] { display: none; }
.lp-spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rk-line); border-top-color: var(--rk-primary); animation: lp-spin 0.8s linear infinite; }
@keyframes lp-spin { to { transform: rotate(360deg); } }

.lp-tip {
  position: absolute; top: 8px; z-index: 3; pointer-events: none; min-width: 148px; padding: 10px 12px;
  background: var(--rk-bg); border: 1px solid var(--rk-line); border-radius: var(--rk-r-sm);
  box-shadow: var(--rk-shadow); font-size: 0.8125rem; line-height: 1.5;
}
.lp-tip[hidden] { display: none; }
.lp-tip .t { color: var(--rk-muted); margin-bottom: 2px; }
.lp-tip .r { display: flex; justify-content: space-between; gap: 16px; }
.lp-tip .r span:first-child { color: var(--rk-muted); }
.lp-widget-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 8px; }

/* ---------- Stats strip ---------- */
.lp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rk-line); border-bottom: 1px solid var(--rk-line); }
.lp-stat { padding: 24px 24px 24px 0; min-width: 0; }
.lp-stat + .lp-stat { padding-left: 24px; border-left: 1px solid var(--rk-line); }
.lp-stat dt { font-size: 0.8125rem; color: var(--rk-muted); }
.lp-stat dd { margin: 6px 0 0; font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.lp-stat dd small { display: block; margin-top: 4px; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; }
.lp-gauge { display: flex; align-items: center; gap: 14px; }
.lp-gauge svg { width: 84px; height: 48px; flex: none; }
.lp-gauge .track { fill: none; stroke: var(--rk-line); stroke-width: 8; stroke-linecap: round; }
.lp-gauge .val { fill: none; stroke: var(--gc, var(--rk-muted)); stroke-width: 8; stroke-linecap: round; }

/* ---------- Markets table ---------- */
.lp-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.lp-search { position: relative; }
.lp-search input {
  height: 36px; width: 200px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--rk-line);
  background: var(--rk-bg); font-size: 0.875rem; outline-offset: 2px;
}
.lp-search input::placeholder { color: var(--rk-muted); }
.lp-search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--rk-muted); pointer-events: none; }

.lp-tablewrap { overflow-x: auto; }
.lp-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.lp-table th { text-align: left; font-size: 0.8125rem; font-weight: 400; color: var(--rk-muted); padding: 0 12px 12px; border-bottom: 1px solid var(--rk-line); white-space: nowrap; }
.lp-table td { padding: 14px 12px; border-bottom: 1px solid var(--rk-line); vertical-align: middle; }
.lp-table tbody tr { transition: background-color 0.15s ease; }
.lp-table tbody tr:hover { background: var(--rk-soft); }
.lp-table .r { text-align: right; }
.lp-table .rank { width: 1%; color: var(--rk-muted); }
.lp-table .star { width: 1%; padding-right: 0; }
.lp-star { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--rk-muted); }
.lp-star:hover { color: var(--rk-ink); background: var(--rk-line); }
.lp-star svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.lp-star[aria-pressed="true"] { color: #e0a100; }
.lp-star[aria-pressed="true"] svg { fill: currentColor; }
.lp-asset { display: inline-flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; }
.lp-asset .lp-coin { font-size: 30px; }
.lp-asset strong { font-weight: 500; letter-spacing: -0.01em; }
.lp-asset .sym { color: var(--rk-muted); font-size: 0.8125rem; margin-left: 8px; }
.lp-asset:hover strong { color: var(--rk-primary); }
.lp-table .price { font-weight: 500; white-space: nowrap; }
.lp-spark { width: 104px; height: 32px; margin-left: auto; }
.lp-spark polyline { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.lp-empty { padding: 32px 12px; color: var(--rk-muted); text-align: center; }
.lp-more { margin-top: 20px; display: flex; justify-content: center; }

/* ---------- Heat map ---------- */
.lp-map { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 96px; grid-auto-flow: dense; gap: 6px; }
.lp-tile {
  --a: 10%;
  position: relative; display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  padding: 12px 14px; border: 0; border-radius: var(--rk-r-sm); cursor: pointer; color: var(--rk-ink); overflow: hidden;
  background: color-mix(in srgb, var(--tc, var(--rk-muted)) var(--a), var(--rk-soft));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lp-tile:hover { box-shadow: inset 0 0 0 1.5px var(--tc, var(--rk-muted)); }
.lp-tile b { font-weight: 500; letter-spacing: -0.01em; }
.lp-tile span { font-size: 0.8125rem; font-weight: 500; }
.lp-tile:nth-child(1) { grid-column: span 2; grid-row: span 2; padding: 18px; }
.lp-tile:nth-child(1) b { font-size: 1.5rem; letter-spacing: -0.025em; }
.lp-tile:nth-child(2), .lp-tile:nth-child(3) { grid-column: span 2; }
.lp-tile:nth-child(n+14) { display: none; }

/* ---------- Converter + steps ---------- */
.lp-duo { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.lp-steps { counter-reset: step; border-top: 1px solid var(--rk-line); margin-top: 28px; }
.lp-steps li { counter-increment: step; display: grid; grid-template-columns: 48px 1fr; gap: 4px 16px; padding: 22px 0; border-bottom: 1px solid var(--rk-line); }
.lp-steps li::before {
  content: counter(step); grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--rk-line); border-radius: 50%; font-size: 0.875rem; font-weight: 500; font-variant-numeric: tabular-nums;
}
.lp-steps h3 { font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; padding-top: 6px; }
.lp-steps p { color: var(--rk-muted); font-size: 0.9375rem; }

.lp-conv { background: var(--rk-soft); border: 1px solid var(--rk-line); border-radius: var(--rk-r-xl); padding: clamp(20px, 3vw, 36px); }
.lp-conv h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; }
.lp-field { margin-top: 16px; display: flex; align-items: stretch; background: var(--rk-bg); border: 1px solid var(--rk-line); border-radius: var(--rk-r-md); }
.lp-field:focus-within { border-color: var(--rk-primary); }
.lp-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.lp-field input { flex: 1; min-width: 0; height: 60px; padding: 0 16px; border: 0; background: transparent; font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; outline: none; font-variant-numeric: tabular-nums; }
.lp-field select { border: 0; background: transparent; padding: 0 12px; font-weight: 500; cursor: pointer; outline-offset: -2px; border-radius: var(--rk-r-md); max-width: 46%; }
.lp-field select option { background: var(--rk-bg); color: var(--rk-ink); }
.lp-field output { flex: 1; min-width: 0; display: flex; align-items: center; height: 60px; padding: 0 16px; font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lp-conv .lp-small { margin-top: 14px; min-height: 1.4em; }
.lp-conv .rk-btn { margin-top: 20px; width: 100%; }

/* ---------- Closing ---------- */
.lp-closing {
  background: var(--rk-cta-bg); color: var(--rk-cta-ink); border-radius: var(--rk-r-xl);
  padding: clamp(40px, 7vw, 88px) clamp(24px, 6vw, 80px);
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.lp-closing .lp-h2 { max-width: 16ch; }
.lp-closing p { margin-top: 12px; color: var(--rk-cta-muted); }
.lp-closing .rk-btn-primary { background: #ffffff; color: #0e1627; }
.lp-closing .rk-btn-primary:hover { background: #dfe6f5; color: #0e1627; }
body.is_dark .lp-closing { border: 1px solid var(--rk-line); }
body.is_dark .lp-closing .rk-btn-primary { background: var(--rk-primary); color: var(--rk-on-primary); }
body.is_dark .lp-closing .rk-btn-primary:hover { background: var(--rk-primary-hover); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .lp-hero-grid, .lp-duo { grid-template-columns: 1fr; }
  .lp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .lp-stat:nth-child(n+3) { border-top: 1px solid var(--rk-line); }
}
@media (max-width: 639px) {
  .lp-widget { padding: 16px 14px 10px; border-radius: 20px; }
  .lp-chips { margin-left: 0; width: 100%; }
  .lp-chartbox { min-height: 300px; }
  .lp-hero-cta .rk-btn { flex: 1 1 100%; }
  .lp-search input { width: 100%; }
  .lp-search { flex: 1 1 100%; }
  .lp-table .col-rank, .lp-table .col-mcap, .lp-table .col-spark { display: none; }
  .lp-table { min-width: 0; }
  .lp-table th, .lp-table td { padding-left: 6px; padding-right: 6px; }
  .lp-asset .sym { display: none; }
  .lp-map { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 84px; }
  .lp-tile:nth-child(1) { grid-column: span 3; }
  .lp-tile:nth-child(2), .lp-tile:nth-child(3) { grid-column: span 1; }
  .lp-tile:nth-child(n+11) { display: none; }
  .lp-stat { padding: 18px 12px 18px 0; }
  .lp-stat + .lp-stat { padding-left: 14px; }
  .lp-gauge svg { width: 64px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* grid children must be allowed to shrink (prevents horizontal overflow on phones) */
.lp-duo > *, .lp-hero-grid > * { min-width: 0; }

@media (max-width: 639px) {
  .lp-tablewrap { max-width: 100%; }
  .lp-table th, .lp-table td { padding: 12px 4px; }
  .lp-table .star { padding-left: 0; }
  .lp-star { width: 28px; height: 28px; }
  .lp-asset { gap: 8px; }
  .lp-asset .lp-coin { font-size: 24px; }
  .lp-asset strong { display: block; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; }
  .lp-table .price, .lp-table td { font-size: 0.875rem; }
  .lp-table td .rk-btn { padding: 0 10px; }
}

@media (max-width: 639px) {
  .lp-field input, .lp-field output { font-size: 1.125rem; height: 56px; padding: 0 12px; }
  .lp-field select { max-width: 42%; font-size: 0.875rem; padding: 0 8px; }
}

/* ---------- Markets page ---------- */
.mk-hero { padding: clamp(32px, 5vw, 64px) 0 clamp(16px, 3vw, 32px); }
.mk-hero .lp-lede { margin-top: 16px; }
.lp-table th button.sort { border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit; font: inherit; display: inline-flex; gap: 4px; align-items: center; }
.lp-table th button.sort::after { content: attr(data-dir); font-size: 0.625rem; }
.lp-table th button.sort:hover { color: var(--rk-ink); }
@media (max-width: 1023px) { .lp-table .col-7d, .lp-table .col-vol { display: none; } }
@media (min-width: 640px) { .lp-table.lp-wide { min-width: 760px; } }
@media (max-width: 639px) { .lp-table .col-7d, .lp-table .col-vol { display: none; } .lp-table th .sort { white-space: nowrap; } }
