/* URBANOVA DISTRICTS · shared site system v3
   Studio system on Claf v6 discipline: paper cream + grain, ink,
   tiered oranges, Funnel Display / Funnel Sans, floating collar nav
   with dashed stitching, cream consoles, hairline facts bands, ink
   footer. Urbanova identity: cartography craft — plate captions,
   coordinate ticks, survey rules. Mobile first on every page. */

@font-face { font-family: "Funnel Display"; src: url("../fonts/FunnelDisplay-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Funnel Display"; src: url("../fonts/FunnelDisplay-800.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Funnel Sans"; src: url("../fonts/FunnelSans-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Funnel Sans"; src: url("../fonts/FunnelSans-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("../fonts/SpaceMono.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("../fonts/SpaceMono-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --paper: #fbf3e8;
  --paper-2: #f5e8d6;
  --paper-3: #eedbc3;
  --card: #fffaf3;
  --cream: #fffaf3;
  --ink: #2a1d15;
  --ink-2: #5b4738;
  --ink-3: #8a7462;
  --mute: #8a7462;
  --line: rgba(42, 29, 21, .12);
  --line-2: rgba(42, 29, 21, .22);
  --org: #e58a4e;
  --org-2: #f4a66e;
  --org-3: #c96d34;
  --peach: #fcdcc1;
  --gold: #d9a441;
  --dark: #1d130d;
  --dark-2: #2e1f16;
  --cream-on-dark: #f7e9d2;
  --radius: 20px;
  --pad: clamp(18px, 4vw, 56px);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font-d: "Funnel Display", "Funnel Sans", sans-serif;
  --font-b: "Funnel Sans", system-ui, sans-serif;
  --font-m: "Space Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; scroll-padding-top: 84px; }
@media (max-width: 760px) { html { scroll-padding-top: 72px; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* clip, not hidden: hidden turns body into a scroll container and breaks the sticky collar */
  position: relative;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
main, header, footer, nav, .ticker, .util-bar { position: relative; z-index: 1; }
a { color: var(--org-3); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 800; line-height: .95; letter-spacing: -.03em; margin: 0; }
h1 em, h2 em { font-style: italic; color: var(--org-2); }
::selection { background: var(--peach); color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- ticker ---------- */
.ticker { display: flex; align-items: stretch; background: var(--dark); color: var(--cream-on-dark); font-family: var(--font-m); font-size: 10.5px; letter-spacing: .05em; }
.ticker-tag { background: transparent; color: var(--org-2); font-weight: 700; padding: 6px 14px 6px var(--pad); letter-spacing: .18em; font-size: 10px; display: flex; align-items: center; text-transform: uppercase; border-right: 1px solid rgba(247, 233, 210, .16); flex: none; }
.ticker-view { overflow: hidden; flex: 1; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-track { display: inline-flex; gap: 18px; white-space: nowrap; padding-left: 18px; animation: tick 48s linear infinite; }
.ticker-track a { color: var(--cream-on-dark); }
.ticker-track a:hover { color: var(--org-2); text-decoration: none; }
.ticker-track i { color: var(--org-2); font-style: normal; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ---------- header / brand ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px var(--pad) 14px; max-width: 1220px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--font-d); font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 11px; transform-origin: 50% 0; animation: brandSway 5.2s ease-in-out infinite; box-shadow: 0 6px 14px -6px rgba(42,29,21,.45); }
@keyframes brandSway { 0%, 100% { transform: rotate(2deg); } 50% { transform: rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .brand img { animation: none; } }
.brand b { color: var(--org-3); font-weight: 800; }
.brand i { font-style: italic; color: var(--org-3); }
.brand > span { display: inline-flex; align-items: center; }
.brand-suf { display: inline-flex; align-items: center; margin-left: 11px; font-family: var(--font-b); font-weight: 700; font-size: 10.5px; letter-spacing: .24em; color: var(--ink-3); }
.brand-suf b { margin-right: 11px; font-family: var(--font-d); font-size: 15px; line-height: 0; letter-spacing: 0; }
.top-r { display: flex; align-items: center; gap: 8px; }
.lang-sw { display: inline-flex; align-items: center; height: 36px; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper-2); }
.lang-sw button { height: 28px; display: inline-flex; align-items: center; border: 0; background: transparent; color: var(--ink-2); font-family: var(--font-m); font-size: 11px; letter-spacing: .04em; padding: 0 12px; border-radius: 999px; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease); }
.lang-sw button:hover { color: var(--ink); }
.lang-sw button.on { background: var(--ink); color: var(--paper); }
.lang-sw button.on:hover { color: var(--paper); }
.x-link { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; font-family: var(--font-m); font-size: 11.5px; letter-spacing: .02em; color: var(--ink-2); white-space: nowrap; transition: border-color .25s var(--ease), color .25s var(--ease), background .25s var(--ease); }
.x-link:hover { color: var(--org-3); border-color: rgba(201, 109, 52, .55); background: #fff8ef; text-decoration: none; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; background: var(--dark); color: var(--cream-on-dark); border-radius: 999px; padding: 0 14px; font-family: var(--font-m); font-size: 11.5px; white-space: nowrap; box-shadow: 0 10px 22px -12px rgba(42,29,21,.6); }
.status-pill .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--org-2); box-shadow: 0 0 0 0 rgba(244,166,110,.6); animation: pulseDot 2.2s infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(244,166,110,.55); } 70% { box-shadow: 0 0 0 8px rgba(244,166,110,0); } 100% { box-shadow: 0 0 0 0 rgba(244,166,110,0); } }
@media (prefers-reduced-motion: reduce) { .status-pill .dot { animation: none; } }
.top a:focus-visible, .top button:focus-visible, .mast a:focus-visible { outline: 2px solid var(--org-3); outline-offset: 2px; }
@media (max-width: 680px) {
  .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand lang" "status status"; align-items: center; column-gap: 10px; row-gap: 10px; padding: 14px var(--pad) 12px; }
  .top .brand { grid-area: brand; }
  .top-r { display: contents; }
  .top .brand, .mast .brand { font-size: 17px; gap: 10px; }
  .mast .wordmark { font-size: 17px; }
  .top .brand img, .mast .brand img { width: 32px; height: 32px; border-radius: 9px; }
  .brand-suf { font-size: 9px; letter-spacing: .2em; margin-left: 8px; }
  .brand-suf b { margin-right: 8px; font-size: 13px; }
  .lang-sw { grid-area: lang; justify-self: end; height: 32px; }
  .lang-sw button { height: 24px; padding: 0 10px; font-size: 10.5px; }
  .x-link { display: none; }
  .status-pill { grid-area: status; justify-self: stretch; height: 32px; border-radius: 12px; font-size: 11px; padding: 0 12px; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
}

/* ---------- floating collar nav (shared chrome) ---------- */
.collar, .navrow { max-width: 1220px; margin: 0 auto; padding: 0 var(--pad); position: sticky; top: 10px; z-index: 60; }
.collar-in, .nav-in {
  position: relative;
  background: var(--dark); color: var(--paper);
  border-radius: 16px; padding: 6px;
  display: flex; gap: 4px; flex-wrap: nowrap; align-items: center;
  box-shadow: 0 22px 40px -20px rgba(42, 29, 21, .55);
}
.collar-in::after, .nav-in::after {
  content: ""; position: absolute; inset: 3.5px; border-radius: 12.5px;
  border: 1px dashed rgba(251, 243, 232, .16); pointer-events: none;
}
.collar a, .nav-in a.link {
  position: relative; z-index: 1;
  padding: 9px 15px; font-size: 13.5px; font-weight: 500; letter-spacing: .015em;
  border-radius: 10px; color: rgba(251, 243, 232, .8); white-space: nowrap;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.collar a::after, .nav-in a.link::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 5px; height: 2px;
  border-radius: 2px; background: var(--org-2);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.collar a:hover, .nav-in a.link:hover { color: var(--paper); background: rgba(251, 243, 232, .08); text-decoration: none; }
.collar a:hover::after, .nav-in a.link:hover::after { transform: scaleX(1); }
.collar a[aria-current="page"], .nav-in a.link[aria-current="page"] { color: var(--org-2); background: rgba(251, 243, 232, .06); }
.collar a[aria-current="page"]::after, .nav-in a.link[aria-current="page"]::after { transform: scaleX(1); }
.collar a:focus-visible, .nav-in a.link:focus-visible { outline: 2px solid var(--org-2); outline-offset: 1px; }
.collar .pill, .nav-in .pill { position: relative; z-index: 1; margin-left: auto; display: inline-flex; align-items: center; height: 32px; font-family: var(--font-m); font-size: 11px; letter-spacing: .03em; color: var(--org-2); background: rgba(244, 166, 110, .1); border: 1px solid rgba(244,166,110,.35); padding: 0 13px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 760px) {
  .collar-in, .nav-in { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .collar-in::after, .nav-in::after { display: none; }
  .collar-in::-webkit-scrollbar, .nav-in::-webkit-scrollbar { display: none; }
  .collar a, .nav-in a.link { flex: none; padding: 8px 12px; font-size: 13px; }
  .collar a::after, .nav-in a.link::after { left: 12px; right: 12px; }
  .collar .pill, .nav-in .pill { display: none; }
  .collar::before, .navrow::before {
    content: ""; position: absolute; top: 0; bottom: 0; right: var(--pad); width: 34px; z-index: 2;
    background: linear-gradient(90deg, rgba(29, 19, 13, 0), var(--dark) 78%);
    border-radius: 0 16px 16px 0; pointer-events: none;
  }
}

/* ---------- utility bar + masthead (inner pages) ---------- */
.util-bar { background: var(--dark); color: var(--cream-on-dark); font-family: var(--font-m); font-size: 10.5px; letter-spacing: .05em; }
.util-in { max-width: 1220px; margin: 0 auto; padding: 6px var(--pad); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: nowrap; }
.util-in span { white-space: nowrap; }
.util-in .u-mid { color: var(--org-2); }
@media (max-width: 640px) { .util-in .u-mid { display: none; } .util-in { font-size: 10px; } }
.mast { max-width: 1220px; margin: 0 auto; padding: 18px var(--pad) 14px; }
.mast-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: nowrap; }
.mast .wordmark { font-size: 20px; }
.mast-meta { display: flex; flex-direction: column; text-align: right; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); gap: 2px; border-left: 1px solid var(--line); padding-left: 18px; }
.mast-meta b { color: var(--ink); }
@media (max-width: 640px) { .mast-meta { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 13px 22px; font-family: var(--font-b); font-weight: 700; font-size: 15px; border: 1px solid transparent; cursor: pointer; background: var(--ink); color: var(--paper); transition: background .2s, transform .25s var(--spring), box-shadow .25s; }
.btn:hover { text-decoration: none; background: #3a291e; transform: translateY(-2px); box-shadow: 0 14px 26px -16px rgba(42,29,21,.55); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--org-2); color: var(--ink); }
.btn.primary:hover { background: #f7b885; }
.btn.ghost { background: var(--cream); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: #fff3e6; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.copy-btn { border: 0; background: var(--org-2); color: var(--ink); border-radius: 10px; font-family: var(--font-b); font-size: 13px; padding: 8px 14px; cursor: pointer; font-weight: 700; transition: background .2s, transform .2s var(--spring); }
.copy-btn:hover { background: #f7b885; }
.copy-btn:active { transform: scale(.96); }

/* ---------- doc pages ---------- */
.dp { max-width: 920px; margin: 0 auto; padding: clamp(38px, 6vw, 68px) var(--pad) 90px; position: relative; z-index: 1; }
.doc .kicker, .kicker { display: inline-block; font-family: var(--font-b); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--org-3); }
.doc h1 { font-size: clamp(44px, 7.5vw, 82px); line-height: .92; letter-spacing: -.04em; margin: 14px 0 10px; }
.doc h1 em { font-style: italic; color: var(--org-2); }
.doc .updated { color: var(--mute); font-family: var(--font-m); font-size: 12.5px; margin: 0 0 10px; }
.doc h2 { font-size: clamp(27px, 4.4vw, 44px); line-height: .95; letter-spacing: -.03em; margin: 52px 0 12px; }
.doc h3 { font-size: clamp(20px, 2.6vw, 26px); letter-spacing: -.02em; margin: 30px 0 8px; }
.doc p { color: var(--ink-2); margin: 0 0 13px; max-width: 68ch; }
.doc p strong, .doc li strong { color: var(--ink); }
.doc ul { color: var(--ink-2); padding-left: 20px; margin: 0 0 13px; max-width: 68ch; }
.doc li { margin-bottom: 6px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc th { text-align: left; font-family: var(--font-m); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.doc td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.doc td.price { font-family: var(--font-m); font-weight: 700; color: var(--ink); white-space: nowrap; }
.tiers { overflow-x: auto; background: var(--cream); border: 1px solid var(--line); border-radius: 26px; padding: 10px 14px; margin: 18px 0; box-shadow: 0 1px 0 #fff inset, 0 30px 60px -40px rgba(80, 40, 15, .35); }
.spec-tag { display: inline-block; font-family: var(--font-m); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper-2); color: var(--ink); }
.spec-tag.haz { background: #f7dfae; }
.tok-stack { display: flex; height: 28px; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--ink); margin: 18px 0 10px; }
.tok-stack .seg-pool { background: var(--org-3); flex: 0 0 20%; }
.tok-stack .seg-wallet { background: var(--dark); flex: 1; }
.tok-legend { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--font-m); font-size: 12.5px; color: var(--ink-2); margin-bottom: 16px; }
.tok-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; }
.lg-pool { background: var(--org-3); } .lg-wallet { background: var(--dark); }
.tok-bars { display: grid; gap: 16px; margin: 12px 0 18px; }
.tok-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.tok-head span { font-family: var(--font-m); color: var(--mute); }
.tok-bar { height: 10px; background: var(--paper-2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.tok-fill { height: 100%; border-radius: inherit; }
.tok-fill.pool { background: linear-gradient(90deg, var(--org-2), var(--org-3)); } .tok-fill.wallet { background: var(--dark); }
.prompt-box { background: var(--dark); color: var(--cream-on-dark); border-radius: 18px; padding: 20px; margin: 16px 0; box-shadow: 0 30px 60px -40px rgba(60, 25, 8, .6); }
.prompt-box pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font-m); font-size: 12.5px; line-height: 1.65; }
.swap-grid { display: grid; gap: 14px; margin: 18px 0; }
@media (min-width: 680px) { .swap-grid { grid-template-columns: 1fr 1fr; } }
.swap-card { background: var(--cream); border: 1px solid var(--line); border-radius: 26px; padding: 24px; box-shadow: 0 1px 0 #fff inset, 0 30px 60px -42px rgba(80, 40, 15, .35); }
.swap-card h3 { margin-bottom: 6px; }
.swap-card p { font-size: 14.5px; }
.swap-card .btn { margin-top: 10px; }

/* ---------- footer ---------- */
.foot { background: var(--dark); color: var(--cream-on-dark); margin-top: clamp(56px, 8vw, 90px); position: relative; }
.foot::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; border-top: 1px dashed rgba(244,166,110,.3); }
.foot-in { max-width: 1220px; margin: 0 auto; padding: 54px var(--pad) 14px; display: grid; gap: 34px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .foot-in { grid-template-columns: 1.5fr 1fr 1fr 1.35fr; } }
.foot .brand { color: var(--cream-on-dark); font-size: 22px; }
.foot .brand img { box-shadow: none; }
.foot-brand p { color: #cdbb9f; font-size: 14px; max-width: 300px; line-height: 1.6; }
.foot-brand a { color: var(--org-2); }
.foot-col h4 { font-family: var(--font-m); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--org-2); margin: 4px 0 14px; }
.foot-col a { display: block; color: rgba(247,233,210,.85); font-size: 14.5px; padding: 4px 0; transition: color .2s; }
.foot-col a:hover { color: var(--paper); text-decoration: none; }
.foot-col a.fc { background: rgba(251,243,232,.05); border: 1px solid rgba(244,166,110,.28); border-radius: 14px; padding: 11px 13px; margin-bottom: 9px; transition: background .2s, border-color .2s; }
.foot-col a.fc:hover { background: rgba(251,243,232,.09); border-color: rgba(244,166,110,.5); }
.foot-col a.fc b { display: block; font-size: 13.5px; color: var(--paper); }
.foot-col a.fc span { font-family: var(--font-m); font-size: 11px; color: #cdbb9f; word-break: break-all; }
.fc-note { font-size: 12.5px; color: #a68f6d; line-height: 1.55; }
.foot-base { max-width: 1220px; margin: 0 auto; padding: 16px var(--pad) 30px; border-top: 1px dashed rgba(244,166,110,.3); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-family: var(--font-m); font-size: 11.5px; color: #a68f6d; }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* ---------- v5 polish: focus, ripple, skeleton, motion safety ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--org-3); outline-offset: 2px; border-radius: 6px;
}
.btn, .copy-btn, .mb-btn { position: relative; overflow: hidden; }
.ink-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(255, 250, 243, .5), transparent);
  transform: scale(0); opacity: .9; animation: inkRipple .65s var(--ease) forwards;
}
.btn.ghost .ink-ripple, .mb-btn.ghost .ink-ripple { background: radial-gradient(closest-side, rgba(201, 109, 52, .35), transparent); }
@keyframes inkRipple { to { transform: scale(2.4); opacity: 0; } }
/* Skeleton shimmer on stat numbers until a first chain read lands
   (board.js adds .chain-live to body, with a timed fallback). */
body:not(.chain-live) .stats .stat b,
body:not(.chain-live) .ledger .stat b,
body:not(.chain-live) .claim-stats .stat b {
  color: transparent !important; width: 72%; min-height: .92em; border-radius: 8px;
  background: linear-gradient(100deg, var(--paper-3) 40%, var(--paper-2) 50%, var(--paper-3) 60%);
  background-size: 220% 100%; animation: skelShine 1.3s linear infinite;
}
@keyframes skelShine { from { background-position: 120% 0; } to { background-position: -80% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
