/* Every page: brand marks beside brand names, and the "where to go next"
   block at the end of the article. Both are added by extra.js and built on the
   main stylesheet's tokens. */

/* ------------------------------------------------------------ brand marks
   The mark is the brand's file from /assets/logos used as a mask, so it takes
   whatever colour it is given: the text colour for the social marks, and each
   network's own colour, in the same light and dark variants the Payments page
   uses, for the networks. */
.brandmark { white-space: nowrap; }
.brandmark::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.35em;
  vertical-align: -0.14em;
  background-color: currentColor;
  -webkit-mask: var(--brand-mark) center / contain no-repeat;
  mask: var(--brand-mark) center / contain no-repeat;
}
.brandmark-threads { --brand-mark: url('/assets/logos/threads.svg'); }
.brandmark-instagram { --brand-mark: url('/assets/logos/instagram.svg'); }
.brandmark-github { --brand-mark: url('/assets/logos/github.svg'); }
.brandmark-solana { --brand-mark: url('/assets/logos/solana.svg'); }
.brandmark-ethereum { --brand-mark: url('/assets/logos/ethereum.svg'); }
.brandmark-base { --brand-mark: url('/assets/logos/base.svg'); }
.brandmark-polygon { --brand-mark: url('/assets/logos/polygon.svg'); }
.brandmark-bnb { --brand-mark: url('/assets/logos/bnb.svg'); }
.brandmark-hyperevm { --brand-mark: url('/assets/logos/hyperevm.svg'); }
.brandmark-bitcoin { --brand-mark: url('/assets/logos/bitcoin.svg'); }

.brandmark-solana::before { background-color: #7d2fd6; }
.brandmark-ethereum::before { background-color: #5a6488; }
.brandmark-base::before { background-color: #0043cc; }
.brandmark-polygon::before { background-color: #6631c4; }
.brandmark-bnb::before { background-color: #b98e08; }
.brandmark-hyperevm::before { background-color: #3f8b7c; }
.brandmark-bitcoin::before { background-color: #d78017; }
:root[data-theme='dark'] .brandmark-solana::before { background-color: #9945FF; }
:root[data-theme='dark'] .brandmark-ethereum::before { background-color: #8A92B2; }
:root[data-theme='dark'] .brandmark-base::before { background-color: #0052FF; }
:root[data-theme='dark'] .brandmark-polygon::before { background-color: #7B3FE4; }
:root[data-theme='dark'] .brandmark-bnb::before { background-color: #F0B90B; }
:root[data-theme='dark'] .brandmark-hyperevm::before { background-color: #97FCE4; }
:root[data-theme='dark'] .brandmark-bitcoin::before { background-color: #F7931A; }

/* ------------------------------------------------- notice on a copied site
   Shown by extra.js only when the page is not being served from the real
   domain. Loud on purpose. */
.not-here {
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 0;
  padding: 12px 20px;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  color: #ffffff;
  background: #a33a2c;
}
.not-here a { color: #ffffff; font-weight: 600; text-decoration: underline; }

/* --------------------------------------------------- contact page marks
   The main stylesheet pins these four marks to one dark grey in every theme,
   which leaves them close to invisible on the dark background and flat on the
   light one. Here they follow the theme, sit a little larger, and Instagram and
   email take a colour of their own. */
:root .contact-card .ic .net-logo {
  width: 20px;
  height: 20px;
  color: var(--text-primary);
}
:root .contact-card .ic .net-logo-mail { color: var(--accent); }
:root .contact-card .ic .net-logo-instagram { color: #d6246e; }
:root[data-theme='dark'] .contact-card .ic .net-logo-instagram { color: #ff5c93; }
.contact-card .ic { border-color: var(--border-secondary); }

/* ------------------------------------------------------- where to go next */
.next {
  max-width: 44rem;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border-secondary);
}

.next-title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.next-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 12px;
}

.next-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 18px;
  color: var(--text-primary);
  text-decoration: none;
  background: var(--background-paper);
  border: 1px solid var(--border-primary);
  border-radius: 5px;
  transition: border-color 0.15s, transform 0.15s;
}
.next-link:hover {
  border-color: var(--text-primary);
  transform: translateY(-2px);
}
.next-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.next-text { flex: 1; min-width: 0; }

/* A Kafra sprite, picked by the script, at its own size: pixel art scaled by
   anything but a whole number smears. */
.next-kafra {
  flex: none;
  width: auto;
  height: auto;
  align-self: flex-end;
  margin: -6px 0 -8px;
}

.next-name {
  display: block;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.next-line {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* It arrives when the reader reaches it: the title first, then each page. */
.next .next-title,
.next .next-link {
  opacity: 0;
  transform: translateY(14px);
}
.next.is-in .next-title,
.next.is-in .next-link {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.15s;
}
.next.is-in .next-link:nth-child(1) { transition-delay: 0.1s, 0.1s, 0s; }
.next.is-in .next-link:nth-child(2) { transition-delay: 0.2s, 0.2s, 0s; }
.next.is-in .next-link:hover { transform: translateY(-2px); transition-delay: 0s; }

/* The border breathes: it warms toward the accent and settles back, slowly,
   and the two cards are half a cycle apart. Hover and focus take over. */
.next.is-in .next-link { animation: next-breathe 3.6s ease-in-out infinite; }
.next.is-in .next-link:nth-child(2) { animation-delay: -1.8s; }
.next.is-in .next-link:hover,
.next.is-in .next-link:focus-visible { animation: none; }
@keyframes next-breathe {
  0%, 100% { border-color: var(--border-primary); box-shadow: 0 0 0 0 transparent; }
  50% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .next.is-in .next-link { animation: none; }
  .next .next-title,
  .next .next-link {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------- language
   The EN/ID switch beside the theme toggle, and the one-time offer to a
   visitor from Indonesia. While a stored Indonesian choice is applied the page
   is hidden; if that takes too long it shows anyway, in English. */
html.i18n-pending body {
  opacity: 0;
  animation: i18n-give-up 0s linear 1.6s forwards;
}
@keyframes i18n-give-up { to { opacity: 1; } }

.lang-toggle {
  margin-left: 8px;
  height: 30px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 0 3px;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1;
}
.lang-toggle span {
  padding: 5px 5px;
  border-radius: 2px;
}
.lang-toggle span.is-on {
  color: var(--primary-contrastText);
  background: var(--text-primary);
}
.lang-toggle:hover { border-color: var(--border-secondary); }
.lang-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lang-offer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
}
.lang-offer.is-open { opacity: 1; }
.lang-offer-box {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  width: min(460px, 100%);
  padding: 22px 22px 20px;
  background: var(--background-default);
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  transform: translateY(8px);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.lang-offer.is-open .lang-offer-box { transform: none; }
.lang-offer-art {
  flex: none;
  width: 88px;
  height: 186px;
  image-rendering: pixelated;
}
.lang-offer-text p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}
.lang-offer-text .lang-offer-title {
  font-size: 18px;
  font-weight: 600;
}
.lang-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
@media (max-width: 420px) {
  .lang-offer-box { flex-direction: column; align-items: center; text-align: center; }
  .lang-offer-art { width: 66px; height: 140px; }
  .lang-offer-actions { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .lang-offer,
  .lang-offer-box { transition: none; }
}
