:root {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #0f1011;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-hover: rgba(255, 255, 255, 0.045);
  --ink: #f7f8f8;
  --muted: #8a8f98;
  --muted-2: #62666d;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --accent: #69f0ae;
  --accent-dim: rgba(105, 240, 174, 0.12);
  --blue: #7170ff;
  --amber: #f0b869;
  --red: #ef6a6a;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% -10%, rgba(105, 240, 174, 0.08), transparent 28rem),
    radial-gradient(circle at 92% 0%, rgba(113, 112, 255, 0.07), transparent 25rem),
    var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv01", "ss03";
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip-link {
  position: fixed;
  z-index: 100;
  top: .75rem;
  left: .75rem;
  transform: translateY(-200%);
  padding: .55rem .75rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
}
.skip-link:focus { transform: translateY(0); color: var(--bg); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
code, pre, .action-id, time {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
code { color: var(--accent); }

.site-header, main, footer {
  width: min(76rem, calc(100% - 2rem));
  margin-inline: auto;
}
.site-header {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: baseline; gap: .55rem; letter-spacing: -.02em; }
.brand strong { font-size: 15px; font-weight: 590; }
.brand span { color: var(--muted-2); font: 500 10px/1 monospace; letter-spacing: .16em; }
nav { display: flex; align-items: center; gap: 1.5rem; }
nav a { color: var(--muted); font-size: 13px; font-weight: 510; }

.explorer-shell { padding: 3rem 0 0; }
.explorer-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 0 2.25rem;
}
.eyebrow {
  display: block;
  margin-bottom: .75rem;
  color: var(--muted-2);
  font: 500 10px/1.4 monospace;
  letter-spacing: .14em;
}
h1, h2, h3 { color: var(--ink); letter-spacing: -.035em; }
h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 4.5rem); font-weight: 510; line-height: 1; }
h2 { margin: .15rem 0 0; font-size: 1.5rem; font-weight: 510; }
h3 { margin: .5rem 0; font-size: 1rem; font-weight: 510; }
p, li { color: var(--muted); }
.lede { max-width: 44rem; margin: 1rem 0 0; font-size: 17px; }
.network-pill {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto auto;
  gap: .2rem .55rem;
  align-items: center;
  min-width: 12.5rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.network-pill code { grid-column: 2; color: var(--muted); font-size: 11px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }

.network-overview { margin-top: 2rem; }
.network-overview .section-heading > small { color: var(--muted-2); font-size: 11px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.stat { min-width: 0; padding: 1.15rem; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat > span, .detail-card > span { display: block; color: var(--muted-2); font-size: 11px; margin-bottom: .35rem; }
.stat strong { display: block; color: var(--ink); font-size: clamp(18px, 2vw, 23px); font-weight: 560; letter-spacing: -.02em; }
.stat code, .stat small { display: block; margin-top: .3rem; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

.activity, .market, .timeline-section, .protocol-facts { margin-top: 3.5rem; }
.global-search { margin: 0 0 2rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.global-search label { display: block; margin-bottom: .55rem; color: var(--muted); font-size: 12px; }
.global-search div { display: flex; gap: .5rem; }
.global-search input { flex: 1; min-width: 0; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 6px; background: #08090a; color: var(--ink); }
.global-search button { padding: .8rem 1.2rem; border: 0; border-radius: 6px; background: var(--accent); color: #06100b; font-weight: 650; cursor: pointer; }
.search-results { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 10px; }
.search-results li { display: grid; grid-template-columns: minmax(15rem, 2fr) 1fr 1fr 1.5fr; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line-soft); }
.search-results li:last-child { border-bottom: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.quiet-link, .back-link { color: var(--muted); font-size: 12px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { width: 100%; min-width: 64rem; border-collapse: collapse; }
th, td { padding: .9rem 1rem; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
th { color: var(--muted-2); font-size: 10px; font-weight: 510; letter-spacing: .09em; text-transform: uppercase; }
td { color: #d0d6e0; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-hover); }
.action-id { color: var(--ink); font-size: 11px; }
.deployment-link { display: flex; flex-direction: column; gap: .15rem; }
.deployment-link strong { color: var(--ink); font-size: 12px; font-weight: 560; }
.deployment-link code { color: var(--muted-2); font-size: 9px; }
time { color: var(--muted); font-size: 10px; }

.type-chip, .status-chip, .payment-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font: 500 10px/1 monospace;
}
.type-DEPLOY { color: var(--accent); border-color: rgba(105, 240, 174, .28); }
.type-INVOKE { color: #9493ff; border-color: rgba(113, 112, 255, .32); }
.type-DELETE { color: var(--amber); border-color: rgba(240, 184, 105, .3); }
.status-SUCCEEDED, .payment-SETTLED { color: var(--accent); }
.status-FAILED, .status-UNKNOWN, .payment-SETTLEMENT_UNKNOWN { color: var(--red); }
.status-EXECUTING, .status-WAITING_EFFECTIVE_TIME, .payment-SETTLING { color: var(--amber); }
.status-PENDING, .payment-UNPAID { color: var(--muted); }

.empty-state { padding: 4rem 1rem; border: 1px dashed var(--line); border-radius: 10px; text-align: center; background: var(--surface); }
.empty-state p { margin: 0; }
.empty-mark { color: var(--accent); font-size: 2rem; }
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.market-grid article, .detail-card, .settlement-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.market-grid strong { font-size: 19px; font-weight: 510; }
.market-grid span { color: var(--muted); font-size: 12px; }

.detail-shell { max-width: 64rem; }
.detail-hero { padding: 2rem 0 1.5rem; }
.detail-hero h1 { margin-bottom: 1rem; font-size: clamp(2rem, 4vw, 3.5rem); }
.detail-id { display: block; color: var(--ink); overflow-wrap: anywhere; }
.detail-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.detail-card strong { font-size: 13px; font-weight: 510; overflow-wrap: anywhere; }
.settlement-card { margin-top: .75rem; }
.settlement-card a { color: var(--accent); }
.settlement-card code { overflow-wrap: anywhere; }
.timeline { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.timeline li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line-soft); }
.timeline li:last-child { border-bottom: 0; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(138, 143, 152, .12); }
.timeline-dot.status-SUCCEEDED { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.timeline-dot.status-EXECUTING, .timeline-dot.status-WAITING_EFFECTIVE_TIME, .timeline-dot.status-UNKNOWN { background: var(--amber); box-shadow: 0 0 0 4px rgba(240, 184, 105, .12); }
.timeline-dot.status-FAILED { background: var(--red); box-shadow: 0 0 0 4px rgba(239, 106, 106, .12); }
.failure-card { display: flex; flex-direction: column; gap: .45rem; margin-top: .75rem; padding: 1.15rem; border: 1px solid rgba(239, 106, 106, .3); border-radius: 8px; background: rgba(239, 106, 106, .06); }
.failure-card strong { color: var(--ink); font-size: 13px; font-weight: 510; }
.failure-code { color: var(--red); }
.timeline li div { display: flex; align-items: baseline; gap: .75rem; }
.timeline li strong { color: var(--ink); font: 500 11px/1 monospace; }
.timeline li div span { color: var(--muted); font-size: 11px; }

.hero { padding: 5rem 0 3rem; max-width: 52rem; }
.badge { display: inline-block; border: 1px solid rgba(105, 240, 174, .35); border-radius: 999px; color: var(--accent); padding: .25rem .65rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.card, .route { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 1.25rem; }
.price { color: var(--ink); font-size: 1.5rem; font-weight: 510; }
pre { overflow-x: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: #050606; color: var(--ink); }
.route { margin-block: .75rem; }
.api-docs { overflow-wrap: anywhere; }
.api-docs nav { flex-wrap: wrap; align-items: flex-start; }
.api-docs nav a { max-width: 100%; }
.api-docs section, .api-docs article, .api-docs details { min-width: 0; max-width: 100%; }
.api-docs pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.api-docs [id] { scroll-margin-top: 10rem; }
.api-docs details > summary { cursor: pointer; color: var(--ink); padding-block: .5rem; }
.route strong { display: block; font-family: "SFMono-Regular", Consolas, monospace; }
.deployment-description { max-width: 46rem; margin: .5rem 0 1rem; font-size: 17px; }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tag-list span { padding: .25rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 500 10px/1.2 monospace; }
.section-nav { position: sticky; top: 0; z-index: 5; gap: .5rem; margin: 0 0 1.5rem; padding: .65rem; border: 1px solid var(--line); border-radius: 9px; background: rgba(8, 9, 10, .94); backdrop-filter: blur(12px); }
.section-nav a { padding: .45rem .65rem; border-radius: 5px; color: var(--muted); font-size: 12px; }
.section-nav a:hover { background: var(--surface-hover); color: var(--accent); }
.service-section { scroll-margin-top: 5rem; margin-top: 3.5rem; padding: 1.4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.service-section pre { margin: 1rem 0; }
.price-inline { color: var(--accent); font-size: 13px; }
.consume-steps { margin: 1.25rem 0; padding-left: 1.5rem; }
.consume-steps li { margin: .6rem 0; }
.docs-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0; }
.docs-links a { color: var(--accent); }
.contract-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.changelog-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.changelog-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line-soft); }
.changelog-entry:last-child { border-bottom: 0; }
.changelog-entry strong { display: block; margin-bottom: .35rem; color: var(--ink); font-size: 14px; }
.changelog-entry p { margin: 0 0 .45rem; color: var(--muted); overflow-wrap: anywhere; }
.changelog-entry time { color: var(--muted-2); font: 11px/1.5 monospace; white-space: nowrap; }
.changelog-list .empty-state { padding: 1.1rem 1.25rem; color: var(--muted); }
#overview, #changelog, #versions, #activity { scroll-margin-top: 5rem; }
footer { border-top: 1px solid var(--line-soft); margin-top: 4rem; padding: 2rem 0; color: var(--muted-2); font-size: 12px; }

@media (max-width: 48rem) {
  .explorer-heading { align-items: flex-start; flex-direction: column; }
  .network-pill { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .market-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 32rem) {
  .site-header { align-items: flex-start; flex-direction: column; justify-content: center; gap: .6rem; padding: .8rem 0; }
  nav { width: 100%; }
  .explorer-shell { padding-top: 1.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .timeline li { grid-template-columns: auto 1fr; }
  .timeline time { grid-column: 2; }
  .changelog-entry { grid-template-columns: 1fr; gap: .65rem; }
  .changelog-entry time { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
