/* u/404 — paper, ink, one magenta.
 *
 * Every colour here was sampled out of the profile art rather than guessed: the cream is #FAF5F0,
 * the rule grey is #DAD7D3, the body grey is #585654 and the accent is #DE3B77. If something on
 * this site is a fourth colour it is a mistake.
 *
 * The layout language is the same as the brand's: a fine lattice of plus marks, hairline rules,
 * corner brackets, and a small magenta square used as punctuation rather than decoration. */

:root {
  --paper: #faf5f0;
  --paper-2: #f2ece6;
  --paper-3: #ebe4dc;
  --ink: #111214;
  --ink-2: #3a3a3c;
  --grey: #585654;
  --grey-2: #8b8783;
  --rule: #dad7d3;
  --accent: #de3b77;
  --accent-2: #c22e64;
  --accent-wash: rgba(222, 59, 119, 0.08);

  --sans: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --bar: 64px;
  --pad: clamp(20px, 4vw, 60px);
  --maxw: 1240px;
  --r: 2px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* the lattice, fixed behind everything, straight out of the brand art */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px;
  background-position: 0 0;
  opacity: 0.42;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

/* ────────────────────────────────────────────────────────────── topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--rule);
  background: rgba(250, 245, 240, 0.86);
  backdrop-filter: blur(12px) saturate(120%);
}

.mark { display: flex; align-items: center; text-decoration: none; flex: none; }
/* The same PNG the contract carries, so the site and the chain show one object rather than two
   drawings of it. Squared off, because the source is a rounded avatar crop. */
/* Cropped to the wordmark: the source is an avatar with a lot of padding, and at 34px
   tall the type inside it was almost invisible. Width follows from the aspect. */
.mark img { display: block; height: 34px; width: auto; }

.tabs { display: flex; gap: 2px; margin-left: auto; }
.tabs a {
  padding: 7px 12px;
  color: var(--grey);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--r);
  transition: color 0.15s, background 0.15s;
}
.tabs a:hover { color: var(--ink); background: var(--paper-2); }
.tabs a.on { color: var(--accent); background: var(--accent-wash); }

.wallet { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.chainpill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--grey);
  white-space: nowrap;
}
.chainpill.bad {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-wash);
  cursor: pointer;
}

/* ───────────────────────────────────────────────────────────── buttons ── */
.btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn[disabled] { opacity: 0.32; pointer-events: none; }
.btn--wallet { font-family: var(--mono); font-size: 12px; font-weight: 500; }

/* ──────────────────────────────────────────────────────────────── page ── */
main { flex: 1 0 auto; }

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 60px) var(--pad) 90px;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(38px, 6vw, 78px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0 0 20px;
}
h1 i { font-style: normal; color: var(--accent); }

h2 {
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 62px 0 16px;
}

h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-2);
  margin: 36px 0 12px;
}

p { margin: 0 0 15px; color: var(--grey); max-width: 66ch; }
p b, strong { color: var(--ink); font-weight: 600; }
.lede { font-size: clamp(16px, 1.9vw, 19.5px); line-height: 1.52; color: var(--ink-2); max-width: 58ch; }
.foot { font-size: 13px; color: var(--grey-2); max-width: 68ch; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-color: rgba(222, 59, 119, 0.35); }

code, .mono { font-family: var(--mono); font-size: 0.89em; }
code { background: var(--paper-2); border: 1px solid var(--rule); padding: 1px 5px; border-radius: var(--r); color: var(--ink); }

pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--ink-2);
  margin: 18px 0;
}

/* ───────────────────────────────────────────────────────────────── hero ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-height: min(64vh, 540px);
}
.hero__claim {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-2);
  margin-top: 26px;
  display: block;
}
.hero__claim b { color: var(--accent); font-weight: 500; }

.scene { position: relative; width: 100%; overflow: hidden; }
.scene canvas { display: block; width: 100% !important; height: 100% !important; }
.scene--sq { aspect-ratio: 1 / 1; }
.scene--wide {
  aspect-ratio: 16 / 6;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  border-radius: var(--r);
}
.scene__cap {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--grey-2);
  margin-top: 10px;
  display: block;
}

/* ───────────────────────────────────────────────────────── stats/cards ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
  margin: 36px 0;
  background: var(--paper-2);
}
.stat {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: 0; }
.stat__k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-2);
}
.stat__v { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.stat__v.accent { color: var(--accent); }
.stat__s { font-size: 12.5px; color: var(--grey); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 26px 0; }
.card {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 22px;
  background: var(--paper);
  position: relative;
  transition: border-color 0.18s;
}
.card:hover { border-color: var(--ink); }
.card__n { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.16em; display: block; margin-bottom: 12px; }
.card h4 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.card p { font-size: 13.5px; margin: 0; }

/* the small magenta square, used as punctuation */
.sq { display: inline-block; width: 8px; height: 8px; background: var(--accent); vertical-align: 1px; }

/* ────────────────────────────────────────────────────────────── banner ── */
.banner {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  border: 1px solid var(--accent);
  background: var(--accent-wash);
  border-radius: var(--r);
  padding: 14px 18px;
  margin: 0 0 32px;
  font-size: 13.5px;
  color: var(--grey);
}
.banner b { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ─────────────────────────────────────────────────────────────── table ── */
.wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 13.5px; }
.table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-2);
  font-weight: 400;
  padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--ink);
}
.table td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--grey); }
.table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.table .num { font-family: var(--mono); color: var(--accent); white-space: nowrap; }

/* ──────────────────────────────────────────────────────────────── docs ── */
.page--docs { display: grid; grid-template-columns: 226px minmax(0, 1fr); gap: clamp(24px, 4vw, 54px); align-items: start; }
.toc { position: sticky; top: calc(var(--bar) + 26px); }
.toc__k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey-2); display: block; margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: flex;
  gap: 10px;
  padding: 6px 0 6px 13px;
  color: var(--grey);
  text-decoration: none;
  font-size: 13px;
  border-left: 1px solid var(--rule);
  transition: color 0.15s, border-color 0.15s;
}
.toc a span { font-family: var(--mono); font-size: 10.5px; color: var(--grey-2); padding-top: 2px; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); }
.toc a.on span { color: var(--accent); }

.chapter__n { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey-2); display: block; margin-bottom: 12px; }
.chapter h1 { font-size: clamp(28px, 4vw, 46px); margin-bottom: 22px; }
.chapter__nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--rule); font-size: 13px; }
.chapter__nav a { text-decoration: none; }
.limits { padding-left: 20px; margin: 18px 0; }
.limits li { color: var(--grey); margin-bottom: 12px; max-width: 66ch; }
.limits li b { color: var(--ink); }

/* ─────────────────────────────────────────────────────────────── forms ── */
.panel { border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); padding: 24px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey-2); }
.field input {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  padding: 11px 13px;
  width: 100%;
}
.field input:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; margin: 0; }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--grey-2); font-family: var(--mono); font-size: 11.5px; margin: 0; }
.kv dd { margin: 0; color: var(--ink); font-family: var(--mono); font-size: 12.5px; text-align: right; word-break: break-all; }

/* ────────────────────────────────────────────────────────────── footer ── */
.bottombar {
  flex: none;
  border-top: 1px solid var(--rule);
  padding: 15px var(--pad);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--grey-2);
}
.bottombar a { color: var(--grey-2); text-decoration: none; }
.bottombar a:hover { color: var(--accent); }

/* ────────────────────────────────────────────────────────────── narrow ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero .scene--sq { max-width: 420px; margin-inline: auto; order: -1; }
  .page--docs { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; }
  .toc a { border-left: 0; border: 1px solid var(--rule); border-radius: var(--r); margin: 0 6px 6px 0; padding: 5px 11px; }
  .toc a.on { border-color: var(--accent); }
  .stat { border-right: 0; border-bottom: 1px solid var(--rule); }
}
@media (max-width: 720px) {
  .topbar { height: auto; flex-wrap: wrap; padding-top: 11px; padding-bottom: 9px; gap: 12px; }
  .mark { margin-right: auto; }
  .tabs { order: 3; width: 100%; overflow-x: auto; margin: 0; gap: 1px; }
  .tabs a { padding: 6px 9px; font-size: 12.5px; }
  .wallet { margin-left: 0; }
  .scene--wide { aspect-ratio: 4 / 3; }
}
