/* Brimstead · stoneware, ink, cobalt (writer) + kiln orange (brim / buyer). Light only. */
:root {
  --bg: #efe9dd;
  --panel: #e4dccb;
  --panel-2: #d9cfba;
  --ink: #13161d;
  --muted: #6b6a64;
  --line: rgba(19, 22, 29, 0.14);
  --cobalt: #2340d8;
  --hot: #ff5b1f;
  --hot-text: #e04a12;
  --risk: #b3261e;
  --shadow: 0 1px 0 rgba(90, 64, 30, 0.06), 0 18px 40px -22px rgba(90, 64, 30, 0.35);
  --serif: 'Young Serif', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: 'Ubuntu Sans Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg, canvas { display: block; max-width: 100%; }
code, .mono { font-family: var(--mono); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 1.05; margin: 0; }
p { margin: 0 0 1em; }
::selection { background: var(--cobalt); color: var(--bg); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font: 500 12px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.eyebrow .pip { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cobalt); margin-right: 8px; vertical-align: 1px; }
.eyebrow .pip.hot { background: var(--hot); }
.cobalt { color: var(--cobalt); }
.hot { color: var(--hot-text); }
.risk { color: var(--risk); }
.muted { color: var(--muted); }
.tba { color: var(--muted); font-style: italic; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font: 600 16px/1 var(--sans); padding: 16px 24px; border-radius: 999px;
  border: 1.5px solid var(--ink); color: var(--ink); background: transparent;
  text-decoration: none; cursor: pointer; transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-hot { background: var(--hot); border-color: var(--hot); color: var(--ink); box-shadow: 0 10px 24px -14px rgba(224, 74, 18, 0.9); }
.btn-hot:hover { background: #ff6d36; }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn[disabled], .btn.is-off { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .arr { transition: transform 0.2s; }
.btn:hover .arr { transform: translateX(3px); }

/* nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; padding: 12px var(--gutter); pointer-events: none; }
.nav-in {
  pointer-events: auto; max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 24px;
  padding: 10px 10px 10px 20px; border-radius: 999px;
  background: rgba(239, 233, 221, 0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}
.wordmark { font: 400 24px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.wordmark .dot, .foot-mark .dot { color: var(--hot); }
.nav-menu { display: flex; gap: 4px; margin: 0 auto; }
.nav-menu a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 14px; border-radius: 999px; }
.nav-menu a:hover, .nav-menu a[aria-current] { background: var(--panel); }
.nav-toggle { display: none; }
.nav-x { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink); border: 1px solid var(--line); flex: none; }
.nav-x:hover { background: var(--panel); }
@media (max-width: 860px) {
  .nav-in { gap: 10px; }
  .nav-menu {
    position: absolute; top: 70px; left: var(--gutter); right: var(--gutter); flex-direction: column; padding: 10px;
    background: var(--bg); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: 0.2s;
  }
  .nav.open .nav-menu { opacity: 1; transform: none; pointer-events: auto; }
  .nav-menu a { font-size: 18px; padding: 12px 14px; }
  .nav-x { margin-left: auto; }
  .nav-toggle {
    display: grid; place-content: center; gap: 5px; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--line); background: transparent; cursor: pointer; padding: 0;
  }
  .nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--ink); transition: 0.2s; }
  .nav.open .nav-toggle span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .nav.open .nav-toggle span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
}

/* CA strip */
.ca-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  font: 400 14px/1.3 var(--mono);
}
.ca-tick { font-weight: 500; color: var(--bg); background: var(--ink); padding: 6px 10px; border-radius: 6px; }
.ca-slot {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%;
  border: 1px dashed rgba(19, 22, 29, 0.35); border-radius: 8px; padding: 4px 4px 4px 10px; background: rgba(255, 255, 255, 0.35);
}
.ca-lbl { color: var(--muted); font-size: 12px; letter-spacing: 0.1em; }
.ca-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 13px; }
.ca-copy {
  font: 500 12px/1 var(--mono); border: 0; background: var(--ink); color: var(--bg); padding: 7px 10px;
  border-radius: 5px; cursor: pointer; flex: none;
}
.ca-copy[disabled] { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
.ca-count { color: var(--hot-text); font-weight: 500; font-variant-numeric: tabular-nums; }
.ca-count::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--hot); margin-right: 8px; vertical-align: 1px; }

/* footer */
.foot { position: relative; z-index: 3; background: var(--bg); border-top: 1px solid var(--line); padding: 72px var(--gutter) 28px; }
.foot-in { max-width: var(--max); margin: 0 auto; }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.foot-cols h4 { font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.foot-cols a, .foot-cols > div > span { display: block; color: var(--ink); text-decoration: none; font-size: 16px; padding: 4px 0; }
.foot-cols a:hover { color: var(--cobalt); }
.foot-mark { font: 400 clamp(56px, 15.4vw, 236px)/0.86 var(--serif); letter-spacing: -0.035em; margin: 64px 0 24px; white-space: nowrap; }
.foot-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; color: var(--muted); }
@media (max-width: 720px) { .foot-cols { grid-template-columns: 1fr 1fr; } }

/* inner pages (docs, token, risks) */
.page { position: relative; z-index: 2; padding: 140px var(--gutter) 96px; }
.page-in { max-width: 880px; margin: 0 auto; }
.page h1 { font-size: clamp(44px, 8vw, 96px); margin: 14px 0 22px; }
.page h2 { font-size: clamp(28px, 4vw, 40px); margin: 64px 0 16px; }
.page h3 { font-size: 22px; margin: 32px 0 10px; }
.page .lede { font-size: clamp(19px, 2.2vw, 22px); color: var(--ink); max-width: 46ch; }
.page ul, .page ol { padding-left: 1.2em; }
.page li { margin: 0 0 0.5em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; }
.toc a { font: 500 13px/1 var(--mono); text-decoration: none; color: var(--ink); border: 1px solid var(--line); padding: 9px 12px; border-radius: 999px; }
.toc a:hover { background: var(--panel); }
.card { background: var(--panel); border-radius: 18px; padding: 24px; }
.note { border-left: 3px solid var(--cobalt); background: rgba(35, 64, 216, 0.06); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; }
.note.warn { border-color: var(--risk); background: rgba(179, 38, 30, 0.06); }
.note.hotline { border-color: var(--hot); background: rgba(255, 91, 31, 0.07); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font: 500 12px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tbl td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kv { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 10px 20px; margin: 18px 0; }
.kv dt { font: 500 13px/1.5 var(--mono); color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 12px; } }
@media (max-width: 560px) {
  .ca-slot { width: 100%; }
  .ca-val { white-space: normal; font-size: 12px; }
}

/* ───────────── v2: logo lockup, cursor, page wipe, skeletons, toasts, focus ───────────── */
.wordmark { display: inline-flex; align-items: center; gap: 10px; }
.wordmark .mark { width: 34px; height: 34px; flex: none; overflow: visible; }
.mark .mark-drop { transform-box: fill-box; }
.foot-mark { display: flex; align-items: center; gap: clamp(10px, 2vw, 28px); }
.foot-mark .foot-logo { width: 0.82em; height: 0.82em; flex: none; overflow: visible; }

:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible { outline-offset: 4px; border-radius: 999px; }

.wipe { position: fixed; inset: 0; z-index: 200; background: var(--hot); pointer-events: none; transform: translateY(100%); display: grid; place-items: center; }
.wipe-mark { width: 64px; height: 64px; background: url(/img/logo.svg) center / contain no-repeat; filter: brightness(0) invert(0.08); opacity: 0.9; }

.cursor {
  position: fixed; left: 0; top: 0; z-index: 150; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--ink); pointer-events: none; transition: width 0.25s, height 0.25s, margin 0.25s, background 0.25s, border-radius 0.25s;
  mix-blend-mode: multiply;
}
.cursor.is-link { width: 46px; height: 46px; margin: -23px 0 0 -23px; background: rgba(255, 91, 31, 0.35); }
.cursor.is-text { width: 3px; height: 26px; margin: -13px 0 0 -1.5px; border-radius: 2px; background: var(--cobalt); }
.cursor.is-down { transform: scale(0.8); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

.skel { position: relative; overflow: hidden; background: var(--panel); border-radius: 16px; }
.skel::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: shimmer 1.3s infinite;
}
.skel-row { height: 72px; margin-bottom: 8px; }
.skel-line { display: inline-block; height: 1em; width: 6em; border-radius: 6px; vertical-align: -2px; }
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }

.ln { will-change: transform; }

.nav-cta { white-space: nowrap; }
@media (max-width: 420px) {
  .nav-in { padding: 8px 8px 8px 14px; gap: 8px; }
  .wordmark { font-size: 20px; gap: 8px; }
  .wordmark .mark { width: 28px; height: 28px; }
  .nav-x { width: 34px; height: 34px; }
  .nav-cta { padding: 9px 12px; font-size: 13px; }
}

/* docs: sticky table of contents with scroll-spy */
.docs-grid { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 220px minmax(0, 880px); gap: 64px; justify-content: center; }
.toc-side { position: relative; }
.toc-side .toc { position: sticky; top: 112px; display: flex; flex-direction: column; gap: 2px; margin: 0; }
.toc-side .toc .eyebrow { margin: 0 0 12px; }
.toc-side .toc a { border: 0; border-left: 2px solid var(--line); border-radius: 0; padding: 8px 12px; font: 500 13px/1.2 var(--mono); color: var(--muted); transition: color 0.2s, border-color 0.2s; }
.toc-side .toc a:hover { background: none; color: var(--ink); }
.toc-side .toc a.on { color: var(--ink); border-left-color: var(--hot); }
.page h2 { scroll-margin-top: 96px; }
@media (max-width: 1080px) {
  .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc-side { position: sticky; top: 76px; z-index: 5; margin: 0 calc(-1 * var(--gutter)) 24px; padding: 8px var(--gutter); background: rgba(239, 233, 221, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); order: 0; }
  .toc-side .toc { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .toc-side .toc .eyebrow { display: none; }
  .toc-side .toc a { flex: none; border-left: 0; border-bottom: 2px solid transparent; padding: 8px 10px; }
  .toc-side .toc a.on { border-bottom-color: var(--hot); }
}
.docs-grid > .page-in { width: 100%; min-width: 0; margin: 0; }
.toc-side .toc { flex-wrap: nowrap; }
@media (min-width: 1081px) { .toc-side .toc { flex-wrap: nowrap; } }
