/* Keyarch Protocol */

:root {
  --blue: #2b6cff;
  --blue-2: #5c96ff;
  --blue-ink: #ffffff;
  --blue-text: #6ea2ff;
  --bg: #05070e;
  --panel: #0b1020;
  --panel-2: #10172c;
  --line: #1a2440;
  --line-2: #26345a;
  --text: #eaf0ff;
  --muted: #8a97b8;
  --good: #3fe0a5;
  --bad: #ff6b7d;
  --warn: #ffc15a;
  --glow: rgba(43, 108, 255, .16);
  --display: "Sora", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.6 var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image:
    radial-gradient(1000px 520px at 78% -120px, rgba(43, 108, 255, .22), transparent 70%),
    radial-gradient(700px 380px at 0% 30%, rgba(92, 150, 255, .06), transparent 70%),
    linear-gradient(rgba(38, 52, 90, .28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 52, 90, .28) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
ul { list-style: none; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.blue { color: var(--blue-text); }
.mono, .tbl td, .kv dd, .stats b, .ac-rows b { font-family: var(--mono); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid var(--line-2); background: transparent; white-space: nowrap; transition: transform .12s, box-shadow .12s, border-color .12s; }
.btn:hover { transform: translateY(-1px); }
.btn.solid { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); box-shadow: 0 8px 24px rgba(43, 108, 255, .35); }
.btn.line:hover { border-color: var(--blue-2); color: var(--blue-2); }
.btn.big { padding: 13px 22px; font-size: 15px; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 50; background: rgba(5, 7, 14, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--text); background: var(--panel); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.chain { font-family: var(--mono); font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.burger { display: none; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line-2); background: none; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.burger span { width: 16px; height: 2px; background: var(--text); }

/* token banner */
.tokenbar { background: linear-gradient(90deg, #1f5bff, #4d8dff); color: #fff; font-size: 14px; }
.tokenbar[hidden] { display: none; }
.tokenbar .in { display: flex; align-items: center; justify-content: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px 16px; text-align: center; }
.tokenbar b { font-weight: 800; }
.tokenbar .ca { font-family: var(--mono); background: rgba(0, 0, 0, .22); border-radius: 7px; padding: 3px 9px; word-break: break-all; }
.tokenbar button, .tokenbar a.tb { border: 1.5px solid #fff; background: transparent; color: #fff; border-radius: 8px; padding: 4px 11px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tokenbar a.tb.solid { background: #fff; color: #1f5bff; }
.tokenbar .count { font-family: var(--mono); font-weight: 600; }

/* ticker */
.ticker { border-bottom: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: marquee 80s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick { display: inline-flex; align-items: center; gap: 9px; padding: 8px 18px; border-right: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.tick b { font-family: var(--display); font-weight: 700; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* hero */
.hero { display: grid; grid-template-columns: 1.2fr .9fr; gap: 56px; align-items: center; padding: 72px 0 56px; }
.kicker { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 18px; }
.pill { background: var(--glow); color: var(--blue-text); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; }
h1 { font: 800 clamp(40px, 6vw, 72px)/1.03 var(--display); letter-spacing: -.035em; }
.lede { color: var(--muted); font-size: 17px; max-width: 56ch; margin: 22px 0 30px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.facts { display: flex; gap: 34px; margin-top: 36px; }
.facts li { display: flex; flex-direction: column; }
.facts b { font: 700 30px/1.1 var(--display); }
.facts span { font-size: 13px; color: var(--muted); }

.anchor-card { background: linear-gradient(170deg, rgba(43, 108, 255, .14), var(--panel) 45%); border: 1px solid var(--line-2); border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.ac-head { display: flex; justify-content: space-between; align-items: center; }
.ac-asset { font-weight: 700; font-size: 17px; }
.ac-state { font-family: var(--mono); font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.ac-state.ok { color: var(--good); } .ac-state.warn { color: var(--warn); }
.ac-arch svg { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.arch-bg { fill: none; stroke: var(--line-2); stroke-width: 16; }
.arch-fg { fill: none; stroke: var(--blue); stroke-width: 16; stroke-dasharray: 0 100; transition: stroke-dasharray .6s; }
.keystone { fill: #fff; }
.needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; transform-origin: 160px 196px; transition: transform .6s; }
.hub { fill: var(--text); }
.ac-rows { display: grid; gap: 8px; }
.ac-rows div { display: flex; justify-content: space-between; border-top: 1px dashed var(--line-2); padding-top: 8px; font-size: 14px; }
.ac-rows span { color: var(--muted); }
.ac-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* panels */
.panel { background: rgba(11, 16, 32, .88); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 28px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font: 700 22px/1.2 var(--display); letter-spacing: -.01em; }
.panel-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.status { font-family: var(--mono); font-size: 12px; color: var(--good); display: inline-flex; align-items: center; gap: 8px; }
.status.bad { color: var(--bad); } .status.bad .dot { background: var(--bad); }
.status.muted { color: var(--muted); }

/* board */
.board-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line-2); background: none; border-radius: 9px; padding: 6px 13px; font-size: 13px; cursor: pointer; color: var(--muted); }
.tab.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.search { background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 12px; font-size: 13px; width: 220px; max-width: 100%; }
.table-scroll { overflow: auto; max-height: 720px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); text-align: left; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 24px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover, .tbl tbody tr.sel { background: var(--glow); }
.tbl .r { text-align: right; }
.pair { display: flex; align-items: center; gap: 12px; font-family: var(--display); }
.logo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #fff; flex: none; }
.logo.xs { width: 16px; height: 16px; }
.logo.avatar { display: inline-grid; place-items: center; background: var(--panel-2); color: var(--blue-text); font: 700 10px var(--mono); }
.pair b { font-weight: 700; }
.pair small { display: block; color: var(--muted); font-size: 11.5px; }
.gap { display: inline-flex; align-items: center; gap: 8px; }
.gapbar { width: 64px; height: 6px; border-radius: 3px; background: var(--line-2); position: relative; overflow: hidden; }
.gapbar i { position: absolute; top: 0; bottom: 0; left: 50%; background: var(--good); }
.good { color: var(--good); } .bad { color: var(--bad); } .muted { color: var(--muted); } .warn { color: var(--warn); }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* curve */
.curve { display: grid; grid-template-columns: 1.5fr 1fr; }
.curve-chart { padding: 18px 12px 12px 18px; border-right: 1px solid var(--line); }
.curve-chart svg { width: 100%; height: 300px; display: block; }
.curve-side { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.field { display: block; }
.field > span { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.field > span b { color: var(--text); font-family: var(--mono); }
.field input[type=range] { width: 100%; accent-color: var(--blue); }
.field select { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line-2); font-size: 14px; }
.kv dt { color: var(--muted); }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); }
.steps article { padding: 24px; border-right: 1px solid var(--line); }
.steps article:last-child { border-right: 0; }
.n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--blue); color: #fff; font-weight: 800; }
.steps h3 { font-size: 17px; margin: 14px 0 6px; }
.steps p { color: var(--muted); font-size: 14px; }

/* lend */
.lend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1px; background: var(--line); }
.lend-card { background: var(--panel); padding: 16px 18px; }
.lend-card .pair { margin-bottom: 10px; }
.lend-card dl div { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.lend-card dt { color: var(--muted); } .lend-card dd { font-family: var(--mono); }
@media (max-width: 560px) {
  .facts { gap: 22px; }
  .facts b { font-size: 26px; }
  .lend-grid { grid-template-columns: 1fr 1fr; }
  .lend-card { padding: 12px; }
  .lend-card .pair small { display: none; }
  .lend-card dl div { font-size: 12px; }
}

/* protocol */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats div { padding: 20px 24px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats span { font-size: 12.5px; color: var(--muted); display: block; }
.stats b { display: block; font-size: 28px; font-weight: 600; margin: 4px 0; }
.stats small { font-size: 12px; color: var(--muted); }
.contracts { border-top: 1px solid var(--line); padding: 16px 24px; display: grid; gap: 8px; font-size: 13.5px; }
.contracts div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.contracts span { color: var(--muted); }
.contracts a { font-family: var(--mono); color: var(--blue-text); word-break: break-all; }

/* roadmap */
.phases { display: grid; grid-template-columns: repeat(3, 1fr); }
.phases article { padding: 22px 24px; border-right: 1px solid var(--line); }
.phases article:last-child { border-right: 0; }
.phases article.now { background: linear-gradient(180deg, var(--glow), transparent); }
.phases h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.phases em { font-style: normal; font: 600 11px var(--mono); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.phases .now em { background: var(--blue); color: #fff; border-color: var(--blue); }
.phases li { position: relative; padding: 5px 0 5px 20px; font-size: 14px; color: var(--muted); }
.phases .now li { color: var(--text); }
.phases li::before { content: ""; position: absolute; left: 0; top: 13px; width: 8px; height: 8px; border-radius: 2px; border: 1.5px solid var(--line-2); }
.phases .now li::before { background: var(--blue); border-color: var(--blue); }

.final { display: flex; align-items: center; gap: 22px; padding: 30px 28px; margin-bottom: 28px; border-radius: 18px; border: 1px solid var(--line-2); background: linear-gradient(110deg, rgba(43, 108, 255, .18), var(--panel) 60%); flex-wrap: wrap; }
.final img { border-radius: 14px; }
.final div { flex: 1; min-width: 220px; }
.final h2 { font-size: 24px; }
.final p { color: var(--muted); }
.foot { padding: 8px 0 48px; }
.foot-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.skel { color: transparent !important; border-radius: 5px; background: linear-gradient(90deg, var(--line) 25%, var(--line-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* responsive */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 44px 0; }
  .curve { grid-template-columns: 1fr; }
  .curve-chart { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps article:nth-child(2) { border-right: 0; }
  .steps article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .phases { grid-template-columns: 1fr; }
  .phases article { border-right: 0; border-bottom: 1px solid var(--line); }
  .chain { display: none; }
  .hide-md { display: none; }
}
@media (max-width: 820px) {
  .burger { display: inline-flex; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .steps article { border-right: 0; border-bottom: 1px solid var(--line); }
  .hide-sm { display: none; }
  .tbl th, .tbl td { padding: 10px 8px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 14px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 14px; }
  .logo { width: 26px; height: 26px; }
  .pair small { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .search { width: 100%; }
  .btn.big { flex: 1; }
  .panel-head, .board-bar { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
