/*
 * btx-community.com. Builds on the look of btxlinks.com (vanities, MIT licence): dark,
 * monospaced, one accent colour per category. Own palette, no company colours. Fonts are
 * self-hosted (see static/fonts/SOURCES.md).
 */

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-sans: "Inter", system-ui, sans-serif;

  --bg: #08080c;
  --bg-raised: #101017;
  --surface: #14141c;
  --surface-hover: #1a1a25;
  --border: #23232f;
  --text: #ecebe4;
  --muted: #9a9aac;
  --faint: #5c5c6a;

  --green: #86e8a0;
  --yellow: #ffc24a;
  --red: #ff6b6b;
  --grey: #8b8b95;

  /* One accent per category, as on btxlinks. */
  --accent: #6ee7ff;
  --a-community: #6ee7ff;
  --a-official: #d7f279;
  --a-network: #82b4ff;
  --a-pools: #ffb43a;
  --a-miners: #86e8a0;
  --a-node-tools: #6ef2d1;
  --a-wallets: #b79cff;
  --a-bridges: #ff9ec4;
  --a-exchanges: #dd93ff;
  --a-facts: #ffd479;
  --a-next: #ff9ec4;
  --a-check: #ffb43a;
  --a-docs: #e3c56b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body.c {
  margin: 0;
  overflow-wrap: break-word;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 30rem at 85% -10%, rgb(110 231 255 / 10%), transparent 70%),
    radial-gradient(50rem 30rem at -10% 20%, rgb(183 156 255 / 8%), transparent 70%),
    linear-gradient(rgb(255 255 255 / 2.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2.5%) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.c-skip {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 8px 12px;
  background: var(--surface);
}

.c-skip:focus {
  left: 16px;
}

.c-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* --- Top bar ---------------------------------------------------------------------------- */

.c-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.c-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.c-logo__mark {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--a-community), var(--a-wallets));
  box-shadow: 0 0 16px rgb(110 231 255 / 60%);
}

.c-logo__slash {
  color: var(--faint);
}

.c-lang {
  display: flex;
  gap: 6px;
}

.c-chip {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.c-chip:hover,
.c-chip--active {
  border-color: var(--accent);
  color: var(--text);
}

/* --- Hero ------------------------------------------------------------------------------- */

.c-hero {
  padding: 48px 0 32px;
}

.c-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.c-hero__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(40px, 9vw, 88px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(90deg, var(--text) 30%, var(--a-community) 70%, var(--a-wallets));
  background-clip: text;
  color: transparent;
}

.c-hero__accent {
  color: var(--a-official);
}

.c-hero__lead {
  max-width: 44rem;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
}

/* --- Live strip ------------------------------------------------------------------------- */

.c-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.c-live {
  --state: var(--grey);

  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgb(255 255 255 / 3%), transparent), var(--bg-raised);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

.c-live--normal {
  --state: var(--green);
}

.c-live--degraded {
  --state: var(--yellow);
}

.c-live--incident {
  --state: var(--red);
}

.c-live__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.c-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--state);
  box-shadow: 0 0 0 0 var(--state);
  animation: c-pulse 2s infinite;
}

@keyframes c-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--state) 60%, transparent);
  }

  100% {
    box-shadow: 0 0 0 12px transparent;
  }
}

.c-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 10px;
  margin: 0;
}

.c-tile {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.c-tile dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.c-tile dd {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.c-tile--status {
  grid-column: span 2;
}

.c-tile--status dd {
  color: var(--state);
  overflow-wrap: normal;
}

.c-tile--wide {
  grid-column: span 2;
}

.c-tile dd.c-tile__sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.c-tile dd.c-tile__sub:empty {
  display: none;
}

.c-subtitle {
  margin: 22px 0 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Shown only while the status page lists a rule change ahead of the chain tip. */
.c-fork {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--yellow);
  border-radius: 12px;
  background: rgb(255 194 74 / 8%);
}

.c-fork[hidden] {
  display: none;
}

.c-fork__title {
  margin: 0 0 6px;
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 16px;
}

.c-fork p {
  margin: 0 0 8px;
}

.c-fork__rows {
  margin: 0 0 10px;
  padding-left: 20px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.c-verdicts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.c-verdict {
  --level: var(--grey);

  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.c-verdict--green {
  --level: var(--green);
}

.c-verdict--yellow {
  --level: var(--yellow);
}

.c-verdict--red {
  --level: var(--red);
}

.c-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--level);
}

.c-updated {
  margin: 12px 0 0;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

.c-warning,
.c-risk {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  background: rgb(255 194 74 / 8%);
}

/* --- Audiences -------------------------------------------------------------------------- */

.c-facts,
.c-start,
.c-upcoming,
.c-checks,
.c-directory {
  margin-top: 56px;
}

/* --- What is BTX, coming soon ----------------------------------------------------------- */

.c-fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 12px;
}

.c-fact {
  --accent: var(--a-facts);

  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  background: var(--surface);
}

.c-fact--next {
  --accent: var(--a-next);
}

.c-fact__title {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 16px;
}

.c-fact p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.c-fact__source {
  margin-top: auto;
  font-size: 13px;
}

.c-caveats {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--muted);
}

.c-caveats li {
  margin-bottom: 4px;
}

.c-add {
  margin: 0 0 8px;
}

.c-audiences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}

.c-audience {
  --accent: var(--a-community);

  position: relative;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.c-audience::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

.c-audience--miners {
  --accent: var(--a-miners);
}

.c-audience--nodes {
  --accent: var(--a-node-tools);
}

.c-audience--check {
  --accent: var(--a-check);
}

.c-audience--doc {
  --accent: var(--a-docs);
}

.c-audience__title {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 18px;
}

.c-audience__text {
  margin: 0 0 14px;
  color: var(--muted);
}

.c-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.c-steps li {
  position: relative;
  padding: 8px 0 8px 34px;
  border-top: 1px solid var(--border);
  counter-increment: step;
}

.c-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 9px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.c-steps a {
  text-decoration: none;
}

.c-steps a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.c-steps strong {
  font-weight: 600;
}

/* --- Directory -------------------------------------------------------------------------- */

.c-muted {
  color: var(--muted);
}

.c-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}

.c-category {
  --accent: var(--a-community);

  margin-top: 36px;
  scroll-margin-top: 16px;
}

.c-category--official,
.c-chip--official {
  --accent: var(--a-official);
}

.c-category--network,
.c-chip--network {
  --accent: var(--a-network);
}

.c-category--pools,
.c-chip--pools {
  --accent: var(--a-pools);
}

.c-category--miners,
.c-chip--miners {
  --accent: var(--a-miners);
}

.c-category--node-tools,
.c-chip--node-tools {
  --accent: var(--a-node-tools);
}

.c-category--wallets,
.c-chip--wallets {
  --accent: var(--a-wallets);
}

.c-category--bridges,
.c-chip--bridges {
  --accent: var(--a-bridges);
}

.c-category--exchanges,
.c-chip--exchanges {
  --accent: var(--a-exchanges);
}

.c-category__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.c-category__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.4;
}

.c-count {
  color: var(--faint);
  font-size: 12px;
}

.c-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.c-card {
  scroll-margin-top: 16px;
}

.c-card__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.c-card__link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 8px 28px -12px var(--accent);
}

.c-card__number {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

.c-card__name {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
}

.c-card__link:hover .c-card__name {
  color: var(--accent);
}

.c-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.c-tag {
  padding: 1px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.c-card__text {
  color: var(--muted);
  font-size: 14px;
}

.c-card__note {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  color: var(--yellow);
  font-size: 13px;
}

.c-removed {
  margin-top: 40px;
  color: var(--muted);
}

.c-removed ul {
  padding-left: 20px;
}

/* --- Footer ----------------------------------------------------------------------------- */

.c-link {
  color: var(--accent);
  text-decoration: none;
}

.c-link:hover {
  text-decoration: underline;
}

.c-footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.c-footer p {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

@media (max-width: 600px) {
  .c-hero {
    padding-top: 24px;
  }

  .c-live {
    padding: 14px;
  }

  .c-tile dd {
    font-size: 18px;
  }

  .c-tile--wide {
    grid-column: auto;
  }
}
