/* XMR ROOTS interface layer, loaded last on every public page. Look: a field guide on warm
   paper (light) or chalked on night soil (dark): ink edges, square corners, hard offset
   shadows, ruler ticks, mono labels. All colours and shapes come from tokens.css.
   Applies the tokens (tokens.css) to the shared pieces: page background, type, header
   and navigation, theme button, buttons, cards, fields, and the empty / loading / error
   states. Presentation only: no element is hidden that was visible before, and every
   message keeps its text. */

/* ---------- Page ---------- */
body { background: var(--ground); color: var(--text); font-size: var(--fs-md); line-height: var(--lh-body); transition: background-color var(--t-med), color var(--t-med); }
body::before {
  background:
    radial-gradient(60rem 36rem at 82% -12%, var(--glow-a), transparent 62%),
    radial-gradient(46rem 36rem at 4% 40%, var(--glow-b), transparent 64%),
    var(--ground);
}
body::after { opacity: var(--grain-opacity); }
:root[data-theme="light"] body::after { mix-blend-mode: multiply; }
::selection { background: var(--hype-fill); color: var(--hype-ink); }
:focus-visible { outline: 2px solid var(--hype); outline-offset: 3px; border-radius: var(--r-xs); }

h1, h2, h3 { color: var(--text); }
h1, h2 { font-weight: 800; font-stretch: 80%; letter-spacing: -.025em; word-spacing: .1em; }
h1 { line-height: .98; }
h2 { line-height: 1; }
p { text-wrap: pretty; }
code, kbd, .address-text { font-family: var(--mono); }
main p code, main li code, main dd code { overflow-wrap: anywhere; }
.fine-print { color: var(--faint); }
.text-link { color: var(--hype); border-bottom-color: color-mix(in srgb, var(--hype) 35%, transparent); }
.eyebrow, .page-eyebrow, .idx { color: var(--hype); font: 600 11.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.idx { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.idx::before { content: ''; width: 26px; height: 1.5px; background: currentColor; }

/* ---------- Header and navigation ---------- */
/* Header: one ink rule, with a ruler's tick marks hanging under it. */
.site-header { background: var(--header-bg); border-bottom: 1.5px solid var(--edge); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }
.site-header.is-stuck { background: var(--header-bg); border-bottom-color: var(--edge); box-shadow: none; }
.site-header::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 9px; pointer-events: none; opacity: .5;
  background: linear-gradient(90deg, var(--edge) 1px, transparent 1px) 0 0 / 60px 9px repeat-x, linear-gradient(90deg, var(--edge) 1px, transparent 1px) 0 0 / 12px 4px repeat-x; }
@media (prefers-reduced-motion: no-preference) { .site-header::after { animation: ruler-in 1.1s var(--ease) both; transform-origin: left; } }
@keyframes ruler-in { from { transform: scaleX(0); } }
.header-inner { gap: clamp(12px, 2vw, 28px); padding-block: 12px; }
.brand { gap: 10px; flex: none; color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: var(--r-sm); }
.brand-word { font-stretch: 85%; }
.brand-word { white-space: nowrap; }
.header-inner .main-nav { gap: 2px; margin-left: 0; }
.main-nav a { padding: 7px 11px; border-radius: var(--r-sm); font-size: 14px; font-weight: 550; color: var(--muted); transition: color var(--t-fast), background var(--t-fast); }
.main-nav a::after { display: none; }
.main-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
/* The page you are on is an inked tab. */
.main-nav a[aria-current='page'] { color: var(--ground); background: var(--text); box-shadow: none; }
.header-actions { gap: 8px; }
.nav-search input { border-radius: var(--r-sm); }
.wallet-button { white-space: nowrap; min-height: 40px; border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); color: var(--text); box-shadow: none; }
.wallet-button:hover:not(:disabled) { background: var(--panel-2); }
.wallet-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 22%, transparent); }
.underground-toggle { border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); box-shadow: none; }
.menu-toggle { border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); }

/* Theme button: shows the theme a click switches to. */
.theme-toggle { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); color: var(--text); box-shadow: none; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-med) var(--ease); }
.theme-toggle:hover { color: var(--hype); background: var(--panel-2); }
.theme-toggle:active { transform: rotate(-20deg) scale(.95); }
.theme-toggle svg { display: block; }
.theme-toggle .theme-icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .theme-icon-moon { display: block; }
.tx-bar .theme-toggle { width: 36px; height: 36px; border-radius: var(--r-sm); box-shadow: none; }

/* The menu's own theme row exists for small screens only. */
.main-nav .nav-theme { display: none; }

/* A crowded header gives way from the right: the labels first, then tighter links. */
/* The header is capped at 1280px: with ROOTS Pay in the menu the header search no longer fits; the page keeps its own search. */
.nav-search { display: none; }
@media (max-width: 1440px) {
  .underground-toggle { padding: 0 12px; }
  .underground-toggle .underground-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}
@media (max-width: 1240px) {
  .main-nav a { padding-inline: 9px; font-size: 13.5px; }
}
@media (max-width: 1180px) {
  .main-nav a { padding-inline: 7px; font-size: 13px; }
}
/* Home and Coins also carry a wallet button: their Underground switch is always icon-only. */
.header-actions:has(#wallet) .underground-toggle { padding: 0 12px; }
.header-actions:has(#wallet) .underground-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
/* With ROOTS Pay the menu no longer fits a 981-1100px header: it folds into the menu button there too
   (the same rules style.css applies at 980px and below). */
@media (min-width: 981px) and (max-width: 1100px) {
  .menu-toggle { display: block; }
  .header-inner .main-nav { position: absolute; left: 0; right: 0; top: 100%; display: none; flex-direction: column; margin: 0; }
  body.menu-open .header-inner .main-nav { display: flex; }
  .main-nav .nav-plant { display: block; color: var(--hype); }
  .header-actions > .button.header-plant { display: none; }
}
@media (max-width: 1100px) {
  .main-nav { gap: 2px; padding: 10px var(--gutter) 18px; background: var(--ground); border-bottom: 1.5px solid var(--edge); box-shadow: var(--shadow-3); }
  .main-nav a { padding: 13px 14px; border-bottom: 0; border-radius: var(--r-sm); font-size: 16px; color: var(--text); }
  .main-nav a[aria-current='page'] { color: var(--ground); box-shadow: none; }
}
@media (max-width: 560px) {
  .header-actions > .theme-toggle { display: none; }
  .main-nav .nav-theme { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; height: auto; margin-top: 6px; padding: 13px 14px; border: 1.5px solid var(--edge); border-radius: var(--r-sm); box-shadow: none; color: var(--text); font-size: 16px; }
  .main-nav .nav-theme:active { transform: none; }
  .header-inner { gap: 8px; padding-block: 10px; }
  .brand { font-size: 1.02rem; gap: 8px; }
  .brand img { width: 28px; height: 28px; border-radius: 7px; }
  .header-actions { gap: 6px; }
  .theme-toggle { width: 38px; height: 38px; }
  .wallet-button { min-height: 38px; padding: 0 12px; font-size: 12.5px; }
}
@media (min-width: 370px) and (max-width: 480px) { .brand-light { display: inline; } }
@media (max-width: 380px) {
  .wallet-button { padding: 0 10px; gap: 6px; }
}
@media (max-width: 899px) { .tx-page .tx-bar .theme-toggle { display: inline-grid; } }

/* ---------- Buttons ---------- */
/* Square, inked, with a hard offset shadow that presses flat when clicked. */
.button { border: 1.5px solid var(--edge); border-radius: var(--r-sm); font-weight: 650; letter-spacing: -.005em; transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-fast), color var(--t-fast), opacity var(--t-fast); }
.button.primary { color: var(--hype-ink); background: var(--hype-fill); box-shadow: 3px 3px 0 var(--edge-hard); }
.button.primary:hover:not(:disabled) { transform: translate(-1px, -1px); background: var(--hype-fill-hover); box-shadow: 4px 4px 0 var(--edge-hard); }
.button.primary:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge-hard); }
.button.primary:disabled { color: var(--faint); background: var(--panel-2); border-color: var(--line-strong); box-shadow: none; }
.button.ghost, .button.secondary { color: var(--text); background: var(--panel); box-shadow: 3px 3px 0 var(--line); }
.button.ghost:hover:not(:disabled), .button.secondary:hover:not(:disabled) { transform: translate(-1px, -1px); background: var(--panel-2); box-shadow: 4px 4px 0 var(--line-strong); }
.button.ghost:active:not(:disabled), .button.secondary:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.button.ghost:disabled, .button.secondary:disabled { border-color: var(--line-strong); box-shadow: none; }
.button:disabled { cursor: not-allowed; }
.button:focus-visible { outline-offset: 4px; border-radius: var(--r-sm); }
.icon-button { border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); }

/* ---------- Fields ---------- */
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--faint) 80%, transparent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid color-mix(in srgb, var(--hype) 70%, transparent); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--hype-fill); }

/* ---------- Cards ---------- */
/* Panels are printed plates: an ink edge and a stacked-paper shadow. */
.coin-card, .calculator, .deployment-panel, .move-card, .docs-card, .stats-panel, .stats-revenue,
.plant-step, .preview-card, .preview-economics, .preview-summary, .plant-success,
.coin-market, .coin-reserve, .coin-section, .coin-about, .coin-trading, .coin-rewards, .coin-fees,
.activity-keeper, .table-scroll, .official-token-card, .brand-status, .setup-panel, .vault-note, .underground-panel {
  border: 1.5px solid var(--edge);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
}
.coin-card, .calculator, .deployment-panel, .move-card, .docs-card, .stats-panel, .plant-step, .preview-economics, .preview-summary,
.coin-market, .coin-reserve, .coin-section, .coin-about, .coin-trading, .coin-rewards, .coin-fees, .activity-keeper, .official-token-card, .brand-status, .setup-panel {
  background: var(--panel);
}
.preview-card { background: var(--raised); }
.stats-revenue { border-radius: var(--r-md); }
.stats-revenue:has(+ .stats-cards) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }
.stats-cards { border: 1.5px solid var(--edge); border-top: 1.5px solid var(--edge); border-radius: var(--r-md); overflow: hidden; background: color-mix(in srgb, var(--ground-2) 60%, transparent); }
.stats-cards article { border-color: var(--line); }
.stats-revenue + .stats-cards { border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); background: var(--panel); box-shadow: var(--shadow-2); }
.tx-card { border: 1px solid var(--edge); background: var(--panel); box-shadow: none; }
.docs-code, .docs-formula { border-radius: var(--r-md); }

/* ---------- States: notices, errors, empty, loading ---------- */
/* Inline status line (hero, forms): a quiet pill with a coloured dot. */
.demo-notice { width: fit-content; max-width: 100%; padding: 8px 14px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--muted); line-height: 1.5; }
.demo-notice::before { background: var(--dawn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dawn) 20%, transparent); }
.hero-copy .fine-print { margin-top: 14px; }
.hero .demo-notice { margin-top: 14px; }
.hero .demo-notice + .demo-notice { margin-top: 8px; }

/* Status messages the scripts mark as errors stay fully visible, as a clear callout. */
.move-status, .stats-status, .activity-banner { border-radius: var(--r-md); }
.move-status:not(:empty) { padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.move-status[data-tone="error"], [data-state="error"].move-status, .setup-message.error {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
}
.move-status[data-tone="ok"] { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.stats-status { background: color-mix(in srgb, var(--dawn) 6%, transparent); border-color: color-mix(in srgb, var(--dawn) 28%, transparent); color: var(--muted); }
.migration-banner { border-radius: var(--r-md); border-left-width: 1px; border-color: color-mix(in srgb, var(--hype) 28%, transparent); }

/* Empty states: calm panel, centred icon, short text. */
.activity-empty, .empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  color: var(--muted);
}
.empty-state svg, .activity-empty svg { color: var(--hype); opacity: .8; }

/* Coin page: loading and "choose a coin" states as centred cards. */
.coin-loading, .coin-empty { max-width: 720px; margin: clamp(24px, 6vw, 72px) auto 0; border: 1.5px solid var(--edge); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow-2); }
.coin-empty { padding: clamp(36px, 6vw, 64px) 24px; }
.coin-empty img { margin: 0 auto 18px; border-radius: var(--r-sm); box-shadow: 0 0 0 1.5px var(--edge); }
.coin-empty h1 { font: 800 clamp(1.8rem, 4vw, 2.6rem)/1 var(--display); font-stretch: 80%; letter-spacing: -.025em; }

/* Loading: skeletons shimmer in the theme's own panel colours. */
.skeleton-card { border-color: var(--line-soft); border-radius: var(--r-lg); }

/* ---------- Toasts and dialogs ---------- */
.toast, .tx-toast { border-radius: var(--r-md); box-shadow: var(--shadow-3); }
.modal, .term-dialog, .underground-panel { border: 1.5px solid var(--edge); border-radius: var(--r-md); box-shadow: 6px 6px 0 var(--edge-hard), var(--shadow-3); }
.modal::backdrop, .term-dialog::backdrop, .underground-panel::backdrop { background: color-mix(in srgb, var(--shade) 55%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1.5px solid var(--edge); }
.footer-links a { transition: color var(--t-fast); }

/* ---------- Light theme touches ---------- */
:root[data-theme="light"] .hero-art .strata { stroke: #a8927a; }
:root[data-theme="light"] .hero-art .grain { fill-opacity: .12; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .demo-notice { font-size: 12.5px; }
  .button.large { min-height: 50px; padding: 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .coin-card:hover, .button:hover:not(:disabled), .button:active:not(:disabled) { transform: none; }
  body, .theme-toggle { transition: none; }
}


/* ---------- Home and coin directory ----------
   Hero (a very large headline, the four numbers as a ledger), the ROOTS band, the fee strata,
   the grove of coin plates, how it works, and a colophon with the protocol status. */
main.home { overflow-x: clip; }
.home-hero, .home-band, .layers, .colophon { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }

.home-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: center; gap: clamp(28px, 5vw, 72px); padding: clamp(40px, 6vw, 84px) 0 clamp(36px, 5vw, 56px); }
/* Tree rings behind the hero: growth, seen in section. */
.home-hero::before { content: ''; position: absolute; z-index: -1; inset: -40px -12vw -20px 38%; pointer-events: none; opacity: .9;
  background: repeating-radial-gradient(circle at 80% 50%, transparent 0 24px, var(--line-strong) 24px 25px);
  -webkit-mask-image: radial-gradient(closest-side at 80% 50%, #000 10%, transparent 100%); mask-image: radial-gradient(closest-side at 80% 50%, #000 10%, transparent 100%); }
.home .hero-title { display: grid; gap: 0; font-size: clamp(1.7rem, 3.2vw, 2.8rem); line-height: 1; letter-spacing: -.03em; }
.home .hero-title .ht-a { font-weight: 300; font-stretch: 100%; color: var(--muted); }
.home .hero-title .ht-m { font-style: normal; font-weight: 800; font-stretch: 75%; font-size: clamp(5rem, 13.5vw, 11.5rem); line-height: .8; letter-spacing: -.045em; margin: .03em 0 .06em -.04em; color: var(--hype); }
.home .hero-title .ht-b { font-weight: 650; font-stretch: 90%; letter-spacing: -.02em; word-spacing: .1em; color: var(--text); }
.directory .hero-title .ht-m { font-size: clamp(3.6rem, 9.4vw, 8rem); }
.home .hero-lede { max-width: 50ch; margin-top: 26px; color: var(--muted); font-size: var(--fs-lg); }
.home .hero-actions { margin-top: 28px; gap: 14px; }
.directory-actions { align-items: center; }
.home .hero-actions .button.large { min-height: 52px; padding: 0 26px; }
.home-new { display: grid; margin-top: 30px; max-width: 520px; border-top: 1.5px solid var(--edge); }
.home-new li { display: grid; grid-template-columns: 88px 1fr; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.home-new b { font: 600 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.home-new a { color: var(--text); font-weight: 500; transition: color var(--t-fast), transform var(--t-fast); }
.home-new a::after { content: ' →'; color: var(--hype); }
.home-new a:hover { color: var(--hype); }
.home .home-hero-copy .demo-notice { margin-top: 22px; }

/* The four numbers, as a ledger. */
.home-hero-side { align-self: center; position: relative; }
.stats.home-stats { display: block; max-width: none; margin: 0; padding: 0; overflow: hidden; border: 1.5px solid var(--edge); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow-2); }
.home-stats .stat, .home-stats .stat:first-child, .home-stats .stat:nth-child(odd), .home-stats .stat:nth-child(even) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'l v' 's v'; align-items: center; column-gap: 16px; padding: 16px 20px; border: 0; border-bottom: 1px dashed var(--line-strong); background: transparent; }
.home-stats .stat:last-child { border-bottom: 0; }
.home-stats .stat span { grid-area: l; font: 600 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.home-stats .stat small { grid-area: s; margin-top: 3px; font-size: 12px; color: var(--faint); }
.home-stats .stat strong { grid-area: v; margin: 0; font: 800 clamp(1.6rem, 2.6vw, 2.3rem)/1 var(--display); font-stretch: 80%; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); text-align: right; }
.home-stats .stat:nth-child(2) strong, .home-stats .stat:nth-child(3) strong { color: var(--hype); }

/* ROOTS band: burned supply and the official token, side by side. */
.home-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1.5px solid var(--edge); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow-2); }
.home-band-one { grid-template-columns: minmax(0, 1fr); }
.home-band .roots-burn, .home-band .official-token-card { margin: 0; max-width: none; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 20px 24px; }
.home-band .official-token-card { border-left: 1.5px solid var(--edge); display: grid; align-content: center; gap: 8px; }
.home-band-one .official-token-card { border-left: 0; }
.home-band .roots-burn { display: grid; align-content: center; gap: 6px; }
.home-band .roots-burn strong { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: clamp(1.4rem, 2.4vw, 2rem); letter-spacing: -.02em; word-spacing: .1em; }
.home-band .official-token-card code { font-size: 12px; color: var(--muted); }
.home-band .official-token-card button { border: 1.5px solid var(--edge); border-radius: var(--r-sm); padding: 5px 12px; background: var(--panel-2); font-weight: 600; }
.home-band .official-token-card button:hover { background: var(--hype-fill); color: var(--hype-ink); }

/* Fee layers: the 2% as four soil strata. */
.layers { margin-top: clamp(56px, 8vw, 104px); }
.rule-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; padding-bottom: 14px; border-bottom: 1.5px solid var(--edge); }
.rule-head .idx { flex: 1 0 100%; }
.rule-head h2 { flex: 1 1 auto; font-size: clamp(2rem, 4.6vw, 3.6rem); }
.layers-bar { display: flex; height: clamp(44px, 6vw, 72px); margin-top: 24px; border: 1.5px solid var(--edge); box-shadow: var(--shadow-2); }
.layers-bar i { flex: var(--w) 1 0; min-width: 0; background-color: var(--c); background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .13) 0 2px, transparent 2px 8px); }
.layers-bar i + i { border-left: 1.5px solid var(--edge); }
.layers-list { display: grid; grid-template-columns: 25fr 25fr 40fr 10fr; margin-top: 4px; }
.layers-list li { display: grid; gap: 2px; align-content: start; min-width: 0; padding: 14px 12px 0 0; }
.layers-list li::before { content: ''; width: 1.5px; height: 14px; margin: -14px 0 8px 0; background: var(--edge); }
.layers-list b { font: 800 clamp(1.7rem, 3.4vw, 2.8rem)/1 var(--display); font-stretch: 80%; letter-spacing: -.02em; color: var(--c); }
.layers-list span { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.layers .fine-print { max-width: 70ch; margin-top: 18px; }

/* Grove: the coin directory. */
.home .section, .directory .section { max-width: none; width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; padding-inline: 0; padding-top: clamp(56px, 8vw, 104px); }
.home .section-head { align-items: flex-end; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1.5px solid var(--edge); }
.home .section-head h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
.home .section-head .section-sub { margin-top: 10px; }
.market-bar { gap: 12px; margin-bottom: 26px; }
.search { height: 44px; max-width: 460px; padding: 0 14px; border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); }
.search:focus-within { border-color: var(--hype); box-shadow: 3px 3px 0 var(--hype); }
.token-count { font: 600 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.sort-label { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.sort-label select { height: 40px; padding: 0 12px; border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); font: 500 13px var(--font); letter-spacing: 0; text-transform: none; }
.view-controls { padding: 0; border: 1.5px solid var(--edge); border-radius: var(--r-sm); overflow: hidden; background: var(--panel); }
.view-controls button { width: 38px; height: 38px; border-radius: 0; }
.view-controls button + button { border-left: 1.5px solid var(--edge); }
.view-controls button.active { background: var(--text); color: var(--ground); }

/* Coin plates: numbered, an arch window for the picture, metrics with dotted leaders. */
.coin-grid:not(.list-view) { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 26px 22px; counter-reset: plate; }
.coin-grid:not(.list-view) .coin-card { counter-increment: plate; display: flex; gap: 0; padding: 0; overflow: visible; border-radius: var(--r-md); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.coin-grid:not(.list-view) .coin-card:hover { transform: translate(-2px, -2px); border-color: var(--edge); box-shadow: 5px 5px 0 var(--edge-hard); }
.coin-grid:not(.list-view) .coin-card::before { content: '№ ' counter(plate, decimal-leading-zero); position: absolute; z-index: 2; top: -11px; left: 14px; padding: 3px 8px; border: 1.5px solid var(--edge); border-radius: var(--r-xs); background: var(--ground); font: 700 11px/1.1 var(--mono); letter-spacing: .1em; color: var(--text); }
.coin-grid:not(.list-view) .coin-card-header { position: relative; display: block; padding: 22px 16px 0; }
.coin-grid:not(.list-view) .coin-avatar { width: 100%; height: auto; aspect-ratio: 1 / 1.04; border: 0; border-radius: 999px 999px var(--r-sm) var(--r-sm); outline: 1.5px solid var(--edge); outline-offset: 5px; background: var(--panel-2); font-size: clamp(2.2rem, 4vw, 3rem); }
.coin-grid:not(.list-view) .coin-avatar img { object-fit: cover; }
.coin-grid:not(.list-view) .reward-tag { position: absolute; z-index: 2; top: -11px; right: 14px; max-width: calc(100% - 96px); margin: 0; padding: 3px 8px; overflow: hidden; border: 1.5px solid var(--edge); border-radius: var(--r-xs); background: var(--ground); font: 700 10px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; color: var(--c-reserve); }
.coin-grid:not(.list-view) .reward-tag.holders { color: var(--c-rewards); background: var(--ground); }
.coin-grid:not(.list-view) .coin-id { margin-top: 20px; }
.coin-grid:not(.list-view) .coin-card h3 { font: 800 1.5rem/1 var(--display); font-stretch: 80%; letter-spacing: -.02em; }
.coin-grid:not(.list-view) .ticker { display: block; margin-top: 5px; font: 500 12px var(--mono); color: var(--muted); }
.coin-grid:not(.list-view) .pair-label { color: var(--faint); }
.coin-grid:not(.list-view) .coin-metrics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 16px 16px 14px; padding: 0; }
.coin-grid:not(.list-view) .coin-metrics > div:first-child { grid-column: auto; }
.coin-grid:not(.list-view) .coin-metrics > div { display: flex; align-items: baseline; gap: 8px; }
.coin-grid:not(.list-view) .coin-metrics dt { display: flex; flex: 1; align-items: baseline; gap: 6px; min-width: 0; font: 500 11px var(--mono); letter-spacing: .02em; color: var(--muted); white-space: nowrap; }
.coin-grid:not(.list-view) .coin-metrics dt::after { content: ''; flex: 1; min-width: 12px; border-bottom: 1.5px dotted var(--line-strong); transform: translateY(-3px); }
.coin-grid:not(.list-view) .coin-metrics dd { flex: none; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: baseline; gap: 4px; margin: 0; font: 700 13px/1.2 var(--mono); letter-spacing: -.02em; }
.coin-grid:not(.list-view) .coin-metrics > div:first-child dd { font-size: 15px; }
.coin-grid:not(.list-view) .coin-metric-amount { display: inline; font: inherit; color: var(--text); }
.coin-grid:not(.list-view) .coin-metrics dd em { display: inline; margin: 0; font: 500 10.5px var(--mono); color: var(--faint); }
.coin-grid:not(.list-view) .coin-bottom { flex-wrap: nowrap; gap: 8px; margin-top: auto; padding: 11px 14px; border-top: 1.5px solid var(--edge); background: var(--ground-2); }
.coin-grid:not(.list-view) .mint-link { min-width: 0; overflow: hidden; font: 500 11px var(--mono); white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.coin-grid:not(.list-view) .trade-button { flex: none; height: 30px; padding: 0 12px; border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--hype-fill); color: var(--hype-ink); font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 2px 2px 0 var(--edge-hard); transition: transform var(--t-fast), box-shadow var(--t-fast); }
.coin-grid:not(.list-view) .trade-button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--edge-hard); }
.coin-grid:not(.list-view) .empty-grid { grid-column: 1 / -1; border: 1.5px dashed var(--edge); border-radius: var(--r-md); background: transparent; }
.skeleton-card { height: 360px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); }

/* How it works. */
.home-how { overflow-x: clip; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: center; gap: clamp(24px, 5vw, 72px); }
.home-how .page-eyebrow { display: none; }
.home-how h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
.home-how .section-sub { max-width: 56ch; margin-top: 14px; }
.home-how .steps { grid-template-columns: 1fr; gap: 0; margin-top: 28px; border-top: 1.5px solid var(--edge); }
.home-how .steps::before, .home-how .steps::after { display: none; }
.home-how .steps li { display: grid; grid-template-columns: 56px 1fr; gap: 0 18px; padding: 20px 0; border-bottom: 1px dashed var(--line-strong); }
.home-how .steps li h3 { margin-top: 2px; font: 800 1.45rem/1.1 var(--display); font-stretch: 85%; letter-spacing: -.02em; }
.home-how .steps li p { grid-column: 2; margin-top: 6px; }
.step-node { width: 44px; height: 44px; border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--hype-fill); color: var(--hype-ink); font-family: var(--display); font-weight: 800; box-shadow: 2px 2px 0 var(--edge-hard); }
.home-how .steps li > .step-node { grid-row: 1 / span 2; }
.home-how .section-note { margin-top: 24px; font-size: 12.5px; }
.home-how .protocol-label { display: inline-block; margin-top: 14px; }
.home-how .hero-art { justify-self: center; width: min(100%, 520px); }

/* Colophon: network and protocol status, set like the credits of a book. */
.colophon { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); margin-top: clamp(56px, 8vw, 104px); border: 1.5px solid var(--edge); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow-2); }
.colophon > .idx { grid-column: 1 / -1; margin: 0; padding: 12px 22px; border-bottom: 1.5px solid var(--edge); background: var(--ground-2); }
.colophon .side-card, .colophon .status-wrap { max-width: none; margin: 0; padding: 20px 22px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.colophon .side-card + .side-card { border-left: 1.5px solid var(--edge); }
.side-title, .colophon .status-main h3 { margin-bottom: 12px; font: 800 1.3rem/1.1 var(--display); font-stretch: 85%; letter-spacing: -.01em; }
.colophon .fine-print { margin-top: 10px; font-size: 12px; line-height: 1.6; }
.console.side-console { display: grid; gap: 8px; max-width: none; margin: 0; padding: 0; border: 0; font-size: 13px; }
.side-console .console-link { margin-left: 0; }
.colophon .status-main p { font-size: 12.5px; color: var(--muted); }
.colophon .status-main p + p { margin-top: 8px; }
.colophon .address-text { font-size: 11.5px; }
.colophon .activation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.colophon .activation-actions .button { min-height: 36px; padding: 0 14px; font-size: 13px; }
.site-footer { width: min(var(--max), 100% - 2 * var(--gutter)); max-width: none; margin-inline: auto; padding-inline: 0; }

@media (max-width: 1000px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .home-hero::before { inset: -20px -20vw 30% 10%; }
  .home-how { grid-template-columns: minmax(0, 1fr); }
  .home-how .hero-art { width: min(100%, 420px); }
}
@media (max-width: 760px) {
  .home-band { grid-template-columns: minmax(0, 1fr); }
  .home-band .official-token-card { border-left: 0; border-top: 1.5px solid var(--edge); }
  .colophon { grid-template-columns: minmax(0, 1fr); }
  .colophon .side-card + .side-card { border-left: 0; border-top: 1.5px solid var(--edge); }
  .layers-list { grid-template-columns: 1fr 1fr; gap: 18px 12px; margin-top: 18px; }
  .layers-list li { padding: 0 0 0 12px; border-left: 3px solid var(--c); }
  .layers-list li::before { display: none; }
  .home-new li { grid-template-columns: 76px 1fr; }
}
@media (max-width: 560px) {
  .home-hero { padding-top: 28px; }
  .home-hero::before { opacity: .45; }
  .home .hero-title .ht-m { font-size: min(30vw, 8.5rem); }
  .directory .hero-title .ht-m { font-size: min(22vw, 6.5rem); }
  .home-stats .stat { padding: 14px 16px; }
  /* Phones: each plate is a horizontal card, the arch window on the left. */
  .coin-grid:not(.list-view) { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .coin-grid:not(.list-view) .coin-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); grid-template-areas: 'av id' 'm m' 'b b'; }
  .coin-grid:not(.list-view) .coin-card-header { display: contents; }
  .coin-grid:not(.list-view) .coin-avatar { grid-area: av; width: 88px; margin: 24px 0 0 16px; }
  .coin-grid:not(.list-view) .coin-id { grid-area: id; align-self: center; margin: 22px 16px 0 14px; }
  .coin-grid:not(.list-view) .coin-metrics { grid-area: m; margin: 20px 16px 14px; }
  .coin-grid:not(.list-view) .coin-bottom { grid-area: b; }
}

/* Inner pages: titles in the same condensed display. */
.move-intro h1, .stats-intro h1, .activity-intro h1, main.doc > h1, .docs-heading h1 { font-size: clamp(2.6rem, 6.2vw, 5rem); line-height: .94; letter-spacing: -.035em; }
.move-intro { margin-bottom: 32px; }
.stats-intro h1 { margin-bottom: 18px; }

/* Roots Terminal: home with art and token tiles, list tabs on one line, compact titles. */
.tx-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 210px); gap: 20px; align-items: center; overflow: hidden; position: relative; }
.tx-hero::before { content: ""; position: absolute; inset: auto -10% -60% 40%; height: 120%; background: radial-gradient(closest-side, color-mix(in srgb, var(--hype) 14%, transparent), transparent); pointer-events: none; }
.tx-hero > * { position: relative; }
.tx-hero-copy { display: grid; gap: 18px; align-content: start; min-width: 0; }
.tx-hero h1 { font-size: clamp(28px, 2.5vw, 40px); }
.tx-hero .tx-intro-actions { margin-top: 0; }
.tx-hero-art svg { display: block; width: 100%; height: auto; }
.txa-glow { stop-color: var(--hype); stop-opacity: .2; }
.txa-glow-end { stop-color: var(--hype); stop-opacity: 0; }
.txa-roots path { stroke: var(--hype); stroke-width: 3; stroke-linecap: round; opacity: .75; }
.txa-dots circle { fill: var(--hype); }
.txa-chip circle { fill: var(--panel-2); stroke: var(--line-strong); stroke-width: 1.5; }
.txa-chip-mark path { stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.txa-ring { fill: var(--panel); stroke: var(--hype); stroke-width: 2; }
@media (prefers-reduced-motion: no-preference) {
  .txa-dots circle { animation: txa-pulse 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .txa-dots circle:nth-child(2) { animation-delay: .5s; }
  .txa-dots circle:nth-child(3) { animation-delay: 1s; }
}
@keyframes txa-pulse { 50% { transform: scale(1.6); opacity: .55; } }

.tx-picks { padding: 18px; }
.tx-picks-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.tx-picks-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.tx-picks-note { font-size: 13px; color: var(--faint); }
.tx-picks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.tx-pick { display: grid; gap: 12px; height: 100%; padding: 14px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--ground-2); color: inherit; transition: border-color var(--dur-1, .15s) ease, transform var(--dur-1, .15s) ease, box-shadow var(--dur-1, .15s) ease; }
.tx-pick:hover, .tx-pick:focus-visible { border-color: color-mix(in srgb, var(--hype) 55%, transparent); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tx-pick .term-logo { border-radius: 16px; box-shadow: 0 0 0 1px var(--line-soft); }
.tx-pick-id { display: grid; gap: 2px; min-width: 0; }
.tx-pick-id strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-pick-id span { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-pick-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font: 12px var(--mono); }
.tx-pick-foot b { font-weight: 500; color: var(--text); white-space: nowrap; }
.tx-pick-foot small { white-space: nowrap; }

/* List tabs: one scrolling line; the venue filter sits on its own line under them. */
.tx-list-tabs { gap: 2px; padding: 2px; border-radius: 12px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.tx-list-tabs button { padding: 6px 10px; font-size: 12.5px; }
.tx-list-tabs:has(.tx-rh-filter) { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; row-gap: 8px; overflow-x: auto; }
.tx-list-tabs:has(.tx-rh-filter) > button { grid-row: 1; }
.tx-list-tabs .tx-rh-filter { grid-row: 2; grid-column: 1 / span 3; justify-self: start; margin: 0; padding: 0 0 0 2px; }
.tx-rowlink { transition: background var(--dur-1, .15s) ease; }
.tx-rowlink .term-logo { box-shadow: 0 0 0 1px var(--line-soft); }

.tx-mw-intro h1 { font-size: clamp(28px, 3.3vw, 44px); }

@media (max-width: 700px) {
  .tx-hero { grid-template-columns: minmax(0, 1fr); }
  .tx-hero-art { order: -1; width: min(160px, 50%); justify-self: center; margin: -6px 0 -10px; }
  .tx-picks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tx-pick { padding: 12px; }
}


/* ---------- Controls: tabs, chips and filters are square too ---------- */
.filter, .pair-tab, .quick-amounts button, .volume-shortcuts button, .pill, .coin-stage, .term-badge, .fw-pill,
.tx-views a, .tx-list-tabs button, .tx-rh-filter button, .term-presets button, .tx-gear, .tx-setup-stages li, .tx-mode,
.tx-trade #term-review-button, .tx-submit, .underground-pill { border-radius: var(--r-sm); }
.tx-setup-stages b { border-radius: var(--r-xs); }

/* ---------- Roots Terminal: the same paper and ink on a trading screen ---------- */
.tx-list { border: 1.5px solid var(--edge); border-radius: var(--r-md); background: var(--panel); }
.tx-trade, .tx-side .tx-card, .tx-center .tx-card { border: 1.5px solid var(--edge); border-radius: var(--r-md); background: var(--panel); box-shadow: none; }
.tx-hero { box-shadow: var(--shadow-2); }
/* The active tab or view is an inked chip, like the active page in the site menu. */
.tx-list-tabs button[aria-selected="true"], .tx-views a[aria-current="page"], .tx-frames button[aria-pressed="true"], .tx-trades-tabs button[aria-selected="true"] { color: var(--ground); background: var(--text); box-shadow: none; }
.tx-list-tabs .tx-rh-filter button[aria-pressed="true"] { color: var(--ground); background: var(--text); border-color: var(--text); }
.tx-list-tabs .tx-rh-filter button { border-radius: var(--r-sm); }
.tx-toggle { border: 1.5px solid var(--edge); background: var(--panel-2); }
.tx-toggle button[aria-selected="true"] { color: var(--hype-ink); background: var(--hype-fill); }
.tx-source button, .tx-source label { border-radius: var(--r-sm); }
.tx-input { border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--ground-2); }
.tx-input:focus-within { border-color: var(--hype); box-shadow: 3px 3px 0 var(--hype); }
.tx-search { border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); }
.tx-chip { border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); }
.tx-icon-btn { border: 1.5px solid var(--edge); border-radius: var(--r-sm); background: var(--panel); }
.tx-rowlink { border-radius: var(--r-sm); border-left: 3px solid transparent; }
.tx-rowlink:hover { background: var(--panel-2); }
.tx-rowlink[aria-current="true"] { background: var(--panel-2); box-shadow: none; border-left-color: var(--hype); }
.tx-ticker { border-top: 1.5px solid var(--edge); }
.tx-pick .term-logo { border-radius: 999px 999px var(--r-sm) var(--r-sm); box-shadow: none; outline: 1.5px solid var(--edge); outline-offset: 3px; margin: 3px 3px 6px; }
.tx-pick { border: 1.5px solid var(--edge); border-radius: var(--r-md); background: var(--panel); }
.tx-pick:hover, .tx-pick:focus-visible { border-color: var(--edge); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--edge-hard); }
.tx-pick-id strong { font: 800 1.2rem/1 var(--display); font-stretch: 80%; letter-spacing: -.01em; }
.tx-picks-head h2 { font-size: 1.7rem; }
.tx-hero h1 { font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: .96; }

/* Production navigation preserved; align its More menu and breakpoint with the new theme. */
.nav-more-menu{background:var(--panel);border-color:var(--line);border-radius:var(--r-sm);box-shadow:var(--shadow-2)}
.main-nav .nav-pay,.main-nav .nav-more-menu a,.nav-more>summary:focus-visible{border-radius:var(--r-xs)}
.main-nav .nav-pay{background:color-mix(in srgb,var(--hype) 7%,transparent);border-color:color-mix(in srgb,var(--hype) 30%,transparent)}
@media(max-width:1100px){.nav-more>summary{justify-content:space-between;padding:15px 0;border-bottom:1px solid var(--line-soft);font-size:16px;color:var(--text)}.nav-more-menu{position:static;width:auto;margin:5px 0 10px;box-shadow:none}.main-nav .nav-more-menu a{padding:12px 11px;font-size:14px}}
