/* The system: black page, white ink, greys by opacity, Inter for everything, Lora italic for the human voice.
   Read docs/site/FOUNDATION.md before adding classes; page files keep their own CSS in web/public/css/<area>.css. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter/inter-latin-wght-normal.woff2') format('woff2-variations'), url('/assets/fonts/inter/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/lora/lora-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/lora/lora-latin-500-italic.woff2') format('woff2');
}

:root {
  --bg: #000;
  --ink: #fff;
  --ink-1: rgba(255, 255, 255, 1);
  --ink-2: rgba(255, 255, 255, 0.64);
  --ink-3: rgba(255, 255, 255, 0.4);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.32);
  --fill: rgba(255, 255, 255, 0.06);

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --voice: 'Lora', Georgia, 'Times New Roman', serif;

  /* type scale (px at 16px root) */
  --t-xs: 0.75rem;     /* 12 */
  --t-sm: 0.875rem;    /* 14 */
  --t-md: 1rem;        /* 16 */
  --t-lg: 1.125rem;    /* 18 */
  --t-xl: 1.375rem;    /* 22 */
  --t-2xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);         /* 24..30 */
  --t-3xl: clamp(2rem, 1.4rem + 2vw, 2.75rem);            /* 32..44 */
  --t-4xl: clamp(2.5rem, 1.6rem + 3.2vw, 4rem);           /* 40..64 */
  --t-voice: clamp(2rem, 0.9rem + 2.5vw, 3.25rem);  /* the typed job: 32..52 */

  --gutter: clamp(16px, 4vw, 64px);
  --max: 1472px;
  --nav-h: 112px;
  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.55;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas, video { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: #fff; color: #000; }

/* ---------- type ---------- */
.h1 { font-size: var(--t-4xl); line-height: 1.04; font-weight: 600; letter-spacing: -0.035em; }
.h2 { font-size: var(--t-3xl); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; }
.h3 { font-size: var(--t-2xl); line-height: 1.2; font-weight: 550; letter-spacing: -0.02em; }
.h4 { font-size: var(--t-xl); line-height: 1.3; font-weight: 550; letter-spacing: -0.012em; }
.lede { font-size: var(--t-lg); line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.small { font-size: var(--t-sm); }
.tiny { font-size: var(--t-xs); }
.quiet { color: var(--ink-3); }
.muted { color: var(--ink-2); }
.strong { font-weight: 600; }
.num, .addr, time { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum', 'cv11'; }
.addr { letter-spacing: 0; }
/* The human voice: only for words a person says to an agent. */
.voice { font-family: var(--voice); font-style: italic; font-weight: 500; letter-spacing: -0.01em; }
.voice-xl { font-family: var(--voice); font-style: italic; font-weight: 500; font-size: var(--t-voice); line-height: 1.22; letter-spacing: -0.012em; }
.voice-lg { font-family: var(--voice); font-style: italic; font-weight: 500; font-size: var(--t-2xl); line-height: 1.3; }

.link { color: var(--ink); border-bottom: 1px solid var(--line-strong); transition: border-color 0.2s; }
.link:hover { border-bottom-color: var(--ink); }
.link-quiet { color: var(--ink-2); transition: color 0.2s; }
.link-quiet:hover { color: var(--ink); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-2); transition: color 0.2s; }
.link-btn:hover { color: var(--ink); }
.link-btn[data-copied] { color: var(--ink); }

.prose { max-width: 68ch; color: var(--ink-2); font-size: var(--t-lg); line-height: 1.65; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { color: var(--ink); font-size: var(--t-2xl); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin-top: 2.2em; }
.prose h3 { color: var(--ink); font-size: var(--t-xl); font-weight: 600; margin-top: 1.8em; }
.prose a { color: var(--ink); border-bottom: 1px solid var(--line-strong); }
.prose a:hover { border-bottom-color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose code, code.inline { font-family: var(--sans); font-size: 0.92em; background: var(--fill); border-radius: 6px; padding: 0.1em 0.35em; color: var(--ink); }
.prose pre { background: var(--fill); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; font-size: var(--t-sm); line-height: 1.6; color: var(--ink); }
.prose pre code { background: none; padding: 0; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { width: 100%; max-width: calc(760px + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.page { padding-top: calc(var(--nav-h) + clamp(32px, 6vw, 88px)); padding-bottom: clamp(64px, 10vw, 140px); }
.page-head { display: grid; gap: 16px; margin-bottom: clamp(40px, 6vw, 72px); max-width: 860px; }
.section { padding-block: clamp(48px, 8vw, 112px); }
.section + .section { border-top: 1px solid var(--line); }
.stack { display: grid; gap: var(--gap, 16px); align-content: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 12px); }
.row-between { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 72px); }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
.aside-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.aside-layout > aside { position: sticky; top: calc(var(--nav-h) + 24px); }
.hairline { border: 0; border-top: 1px solid var(--line); margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .split, .split-even, .cols-3, .aside-layout { grid-template-columns: minmax(0, 1fr); }
  .aside-layout > aside { position: static; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius);
  font-size: var(--t-sm); font-weight: 600; line-height: 1; letter-spacing: -0.005em; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer; user-select: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--ink); color: #000; }
.btn-primary:hover { background: rgba(255, 255, 255, 0.86); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink-2); padding-inline: 4px; }
.btn-quiet:hover { color: var(--ink); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: var(--t-md); }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.35; cursor: not-allowed; transform: none; }
/* Square white send button with an up arrow (the first screen's). Put an svg.arrow inside. */
.btn-send { width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 12px; background: var(--ink); color: #000; }
.btn-send:hover { background: rgba(255, 255, 255, 0.86); }
.btn-send svg { width: 24px; height: 24px; }

/* ---------- inputs: a single hairline underneath ---------- */
.field { display: grid; gap: 8px; }
.field-label { font-size: var(--t-sm); color: var(--ink-2); }
.field-help { font-size: var(--t-sm); color: var(--ink-3); }
.field-error { font-size: var(--t-sm); color: var(--ink); font-weight: 600; }
.input, .textarea, .select {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  padding: 10px 0 12px; font-size: var(--t-lg); color: var(--ink); outline: none; transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .textarea:hover, .select:hover { border-bottom-color: rgba(255, 255, 255, 0.5); }
.input:focus, .textarea:focus, .select:focus { border-bottom-color: var(--ink); }
.input[aria-invalid='true'] { border-bottom-color: var(--ink); border-bottom-width: 2px; }
.textarea { resize: none; line-height: 1.4; }
.input-voice { font-family: var(--voice); font-style: italic; font-weight: 500; font-size: var(--t-2xl); }
.input-suffix { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line-strong); }
.input-suffix:focus-within { border-bottom-color: var(--ink); }
.input-suffix .input { border-bottom: 0; }
.input-suffix > span { color: var(--ink-3); font-size: var(--t-md); white-space: nowrap; }
.select { background-image: none; cursor: pointer; }
/* Choice rows: radio or checkbox as a whole row; the chosen one is filled, the others outlined. */
.choices { display: grid; gap: 10px; }
.choice { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.choice:hover { border-color: var(--line-strong); }
.choice input { appearance: none; -webkit-appearance: none; margin: 2px 0 0; width: 18px; height: 18px; border: 1.5px solid var(--ink-3); border-radius: 50%; display: grid; place-content: center; }
.choice input[type='checkbox'] { border-radius: 5px; }
.choice input:checked { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px #000; }
.choice:has(input:checked) { border-color: var(--ink); }
.choice-title { font-weight: 600; }
.choice-text { color: var(--ink-2); font-size: var(--t-sm); margin-top: 2px; }

/* ---------- tables: plain rows with hairlines ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th { text-align: left; font-weight: 400; color: var(--ink-3); padding: 0 16px 12px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 15px 16px 15px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.table tr:last-child td { border-bottom: 0; }
.table .right, .table th.right { text-align: right; padding-right: 0; }
.table td.num, .table th.num { text-align: right; }
.table a { border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.table a:hover { border-bottom-color: var(--line-strong); }

/* Key and value rows (rules, limits, settings). */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; column-gap: 32px; }
.kv > dt, .kv > dd { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.kv > dt { color: var(--ink-3); }
.kv > dd { color: var(--ink); font-variant-numeric: tabular-nums; }
.kv > dt:last-of-type, .kv > dd:last-of-type { border-bottom: 0; }

/* A big number with its words underneath (stats). Use in a .cols-3 or .stats row. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px 40px; }
.stat-value { font-size: var(--t-3xl); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--ink-2); font-size: var(--t-sm); margin-top: 8px; }

/* Activity list: one event per row. */
.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-time { color: var(--ink-3); font-size: var(--t-sm); white-space: nowrap; }

/* Empty state: plain words and a way forward. */
.empty { display: grid; gap: 14px; justify-items: start; padding: clamp(32px, 6vw, 64px) 0; max-width: 560px; }
.empty .lede { font-size: var(--t-md); }

/* Notes and inline messages. Outlined, never coloured. */
.note { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink-2); font-size: var(--t-sm); }
.note strong { color: var(--ink); }
.note-strong { border-color: var(--ink); color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--ink); color: #000; border-radius: var(--radius); padding: 12px 18px; font-size: var(--t-sm); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); z-index: 100; }
.toast[data-show] { opacity: 1; transform: translate(-50%, 0); }

/* A panel grouped by space and one hairline, no shadow. */
.panel { border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 32px); }

/* Tabs: words; the current one is white and underlined. */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button { background: none; border: 0; padding: 0 0 14px; margin-bottom: -1px; color: var(--ink-3); font-size: var(--t-sm); font-weight: 500; cursor: pointer; white-space: nowrap; border-bottom: 1px solid transparent; }
.tabs [aria-current='page'], .tabs [aria-selected='true'] { color: var(--ink); border-bottom-color: var(--ink); }

/* Dot canvases (three.js rings) sit in a box you size; the canvas fills it. */
.dots-box { position: relative; }
.dots-box > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- nav ---------- */
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: #000; padding: 10px 14px; border-radius: var(--radius); font-weight: 600; }
.skip:focus { top: 12px; }
.nav { position: absolute; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h); }
.nav-inner { height: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); display: flex; align-items: center; gap: 34px; }
.nav-mark { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; font-weight: 600; letter-spacing: -0.01em; }
.nav-mark .mark { flex: none; }
.nav-brand { font-size: var(--t-md); }
.nav-links { display: flex; gap: 34px; font-size: 15px; }
.nav-links a { color: var(--ink-2); transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current='page'] { color: var(--ink); }
.token { display: inline-flex; align-items: baseline; gap: 14px; font-size: var(--t-sm); white-space: nowrap; }
.nav-token { margin-left: 30px; }
.token-addr { color: var(--ink-3); transition: color 0.2s; }
.token-addr:hover { color: var(--ink); }
.token-buy { color: var(--ink); font-weight: 600; font-size: 15px; margin-left: 8px; }
.token-buy:hover { opacity: 0.8; }
.nav-cta { min-height: 40px; padding: 0 18px; }
.nav-wallet { display: inline-flex; align-items: center; font-size: var(--t-sm); white-space: nowrap; margin-right: -14px; }
.nav-wallet .btn { min-height: 40px; padding: 0 16px; }
.nav-wallet:has(.app-wallet-addr) { margin-right: 0; }
.nav-wallet .app-wallet-addr, .sheet-wallet .app-wallet-addr { color: var(--ink-2); margin-right: 14px; }
.sheet-wallet { display: none; padding-top: 14px; font-size: var(--t-sm); white-space: nowrap; }
.nav-menu { display: none; position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; color: var(--ink-2); font-size: var(--t-sm); padding: 10px 2px; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu[open] > summary { color: var(--ink); }
.nav-sheet { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: #000; border: 1px solid var(--line); border-radius: 14px; padding: 10px 18px 14px; display: grid; }
.nav-sheet > a { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.nav-sheet > a:hover { color: var(--ink); }
.sheet-token { padding-top: 14px; }
@media (max-width: 1100px) {
  .nav-links { gap: 24px; }
  .nav-inner { gap: 24px; }
  .nav-token { margin-left: 8px; }
}
@media (max-width: 960px) {
  .nav-links, .nav-token { display: none; }
  .nav-menu { display: block; }
  .nav-inner { gap: 16px; }
  .nav-wallet { margin-right: 0; }
  :root { --nav-h: 72px; }
}
@media (max-width: 600px) {
  .nav-inner > .nav-wallet { display: none; }
  .sheet-wallet { display: block; }
}

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 88px) 0 56px; font-size: var(--t-sm); position: relative; z-index: 2; background: var(--bg); }
.footer-inner { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(auto-fit, minmax(140px, 1fr)); gap: 40px; }
.footer-brand { display: grid; gap: 14px; align-content: start; }
.footer-title { font-size: var(--t-sm); font-weight: 400; color: var(--ink-3); margin-bottom: 14px; }
.footer-group ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.footer-group a { color: var(--ink-2); transition: color 0.2s; }
.footer-group a:hover { color: var(--ink); }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- token block (landing, and anywhere the full contract is shown) ---------- */
.token-full { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.token-full-label { color: var(--ink-3); font-size: var(--t-sm); }
.token-full-addr { font-size: var(--t-md); font-variant-numeric: tabular-nums; word-break: break-all; flex: 1 1 280px; }
.token-full-addr:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.token-full-actions { display: inline-flex; gap: 10px; }

/* ---------- 404 ---------- */
.nf { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px; padding-top: var(--nav-h); padding-bottom: 64px; }
.nf-copy { display: grid; gap: 22px; justify-items: start; max-width: 620px; }
.nf-line { font-size: var(--t-voice); line-height: 1.2; overflow-wrap: anywhere; }
.nf-path { color: var(--ink-3); }
.nf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.nf-art { position: relative; aspect-ratio: 1 / 0.8; width: 100%; }
.nf-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 900px) {
  .nf { grid-template-columns: 1fr; align-content: center; padding-top: calc(var(--nav-h) + 24px); }
  .nf-art { order: -1; max-width: 420px; aspect-ratio: 1 / 0.7; }
}

/* ---------- focus and motion ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.btn:focus-visible { outline-offset: 3px; border-radius: var(--radius); }
.input:focus-visible, .textarea:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
.footer-brand .footer-x { color: var(--ink-2); transition: color 0.2s; }
.footer-brand .footer-x:hover { color: var(--ink); }
