/* MIRAI chrome, shared by every page (concept A "One studio"): the header, the footer, the menus, the toast and the
   wallet modal. On the studio pages (body.studio: home, board, agents, participate) the header sits over the reading
   column and the studio panel; on every other page it is a full-width bar. The header is one named view-transition
   group, so it stays put while pages change; the brass marker under the active link glides between links. */
@font-face { font-family: "Chakra Petch"; src: url(/fonts/chakra-petch-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/ibm-plex-mono-400-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/ibm-plex-mono-500-latin.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root { --hdr: 64px; }
html { background: #0b0b0c; }
.hdr, .foot, .toast, .modal, .skip {
  --c-bg: #0b0b0c; --c-panel: #0f0f11; --c-line: #232327; --c-line2: #2e2e33; --c-ink: #f1f0ec; --c-ink2: #c9c8c2; --c-mute: #9a9993;
  --c-dim: #6c6b67; --c-brass: #d8c08a; --c-live: #9fd6a6; --c-ease: cubic-bezier(.22, .61, .36, 1);
  --c-title: "Chakra Petch", "Inter", system-ui, sans-serif; --c-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --c-mono: "Plex Mono", ui-monospace, Menlo, monospace;
}
.skip { position: fixed; left: -999px; top: 10px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--c-ink); color: var(--c-bg); font: 500 14px var(--c-body); }
.skip:focus { left: 12px; }

/* ── header ── */
.hdr { position: sticky; top: 0; z-index: 50; height: var(--hdr); display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 var(--gut, 40px); background: rgba(15, 15, 17, .9); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  font-family: var(--c-body); view-transition-name: hdr; }
.hdr::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(241, 240, 236, .16) 0%, rgba(241, 240, 236, .1) 55%, rgba(159, 214, 166, .32) 100%); }
.hdr a { color: inherit; text-decoration: none; }
.hdr-l { position: relative; display: flex; align-items: center; gap: 34px; min-width: 0; }
.hdr-r { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.hdr .brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--c-ink); }
.hdr .brand img { display: block; height: 28px; width: auto; filter: none; }
.hdr .brand b { font: 700 19px/1 var(--c-title); letter-spacing: .05em; }
.hdr .nav { display: flex; align-items: center; gap: 24px; margin: 0; }
.hdr .nav > a, .hdr .more > button { position: relative; display: inline-flex; align-items: center; height: var(--hdr); padding: 0; border: 0; background: none; box-shadow: none;
  color: var(--c-mute); font: 400 14.5px/1 var(--c-body); cursor: pointer; white-space: nowrap; transition: color .2s; }
.hdr .nav > a:hover, .hdr .more > button:hover, .hdr .more.open > button, .hdr .nav > a[aria-current="page"] { color: var(--c-ink); }
.navmark { position: absolute; left: 50%; bottom: 14px; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: var(--c-brass, #d8c08a); view-transition-name: navmark; }
.hdr .more { position: relative; }
.hdr .more > button svg { display: block; width: 10px; height: 10px; margin-left: 6px; transition: transform .2s var(--c-ease); }
.hdr .more.open > button svg { transform: rotate(180deg); }
.hdr .drop { position: absolute; top: calc(100% - 6px); left: -16px; width: 300px; max-height: calc(100vh - 76px); overflow-y: auto; padding: 6px; background: #131315; border: 1px solid var(--c-line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .18s var(--c-ease), transform .18s var(--c-ease), visibility 0s .18s; }
.hdr .more.open .drop { opacity: 1; visibility: visible; transform: none; transition: opacity .18s var(--c-ease), transform .18s var(--c-ease); }
.hdr .drop a { display: grid; gap: 1px; padding: 9px 12px; border-radius: 9px; font-size: 14px; color: var(--c-ink); }
.hdr .drop a span { color: var(--c-dim); font-size: 12.5px; }
.hdr .drop a:hover { background: #1b1b1e; }
.hdr .soc { display: flex; gap: 4px; width: auto; height: auto; border-radius: 0; background: none; }
.hdr .soc a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--c-ink2); transition: color .2s, background-color .2s; }
.hdr .soc a:hover { color: var(--c-ink); }
.hdr .soc svg { display: block; width: 16px; height: 16px; fill: currentColor; }
.hdr-r .soc a, .openapp { background: rgba(14, 14, 16, .58); border: 1px solid rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
.hdr-r .soc a:hover, .openapp:hover { background: rgba(26, 26, 29, .8); }
.openapp { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; font: 500 14px/1 var(--c-body); color: var(--c-ink); transition: background-color .2s; white-space: nowrap; }
.openapp svg { display: block; width: 12px; height: 12px; }
.hdr .burger { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--c-line); background: transparent; padding: 0; cursor: pointer; }
.hdr .burger i { display: block; width: 16px; height: 1.5px; margin: 4px auto; background: var(--c-ink); transition: transform .25s var(--c-ease), opacity .2s; }
.hdr .nav-soc { display: none; }

/* the studio pages: the header lies over the reading column (solid) and the studio panel (only its buttons) */
.studio .hdr { position: fixed; left: 0; right: 0; padding: 0; display: grid; grid-template-columns: var(--colw) 1fr; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
.studio .hdr::after { display: none; }
.studio .hdr > * { pointer-events: auto; }
.studio .hdr-l { height: 100%; padding: 0 var(--gut); background: var(--c-panel); }
.studio .hdr-l::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(241, 240, 236, .16) 0%, rgba(241, 240, 236, .1) 55%, rgba(159, 214, 166, .32) 100%); }
.studio .hdr-r { padding: 0 18px; pointer-events: none; }
.studio .hdr-r > * { pointer-events: auto; }

/* ── footer ── */
.foot { position: relative; margin-top: 80px; border-top: 1px solid #1b1b1e; background: var(--c-panel); color: var(--c-mute); font: 400 13.5px/1.5 var(--c-body); }
.foot a { color: inherit; text-decoration: none; }
.foot-in { max-width: var(--max, 1520px); margin: 0 auto; padding: 28px var(--gut, 40px) 30px; }
.studio .foot { margin: 72px calc(var(--gut) * -1) 0; }
.studio .foot-in { padding: 28px var(--gut) 30px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot nav a:hover { color: var(--c-ink); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 22px; font-size: 12px; color: var(--c-dim); }
.foot-base a { text-decoration: underline; text-underline-offset: 3px; }
.foot-base a:hover { color: var(--c-ink); }
.foot .mono { font-family: var(--c-mono); }
.cachip { display: inline-flex; align-items: center; gap: 10px; font: 500 12.5px/1 var(--c-mono, "Plex Mono", ui-monospace, monospace); color: var(--c-dim, #6c6b67); }
.cachip b { color: var(--c-brass, #d8c08a); font-weight: 500; letter-spacing: .08em; }
.cachip.set { max-width: 100%; padding: 6px 6px 6px 12px; border: 1px solid #2a2a2e; border-radius: 12px; background: #131315; color: #f1f0ec; }
.cachip.set .addr { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.cachip button { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid #2a2a2e; background: transparent; color: #9a9993; cursor: pointer; }
.cachip button:hover { color: #f1f0ec; border-color: #3a3a40; }

/* ── toast and wallet modal ── */
.toast { position: fixed; z-index: 90; left: 50%; bottom: 26px; transform: translate(-50%, 10px); max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px; background: #1b1b1e; border: 1px solid var(--c-line2);
  color: var(--c-ink); font: 400 13.5px/1.4 var(--c-body); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--c-ease); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 16px; background: rgba(5, 5, 6, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-family: var(--c-body); color: var(--c-ink); }
.modal.open { display: grid; }
.modal-box { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border-radius: 16px; background: #141416; border: 1px solid var(--c-line2); clip-path: none; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.modal-box h3 { margin: 0 0 6px; font: 500 19px/1.25 var(--c-title); }
.modal-box .note { margin: 0; color: var(--c-mute); font-size: 13.5px; }
.modal .wallets { display: grid; gap: 8px; margin: 18px 0 12px; }
.modal .wallets button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #1a1a1d; border: 1px solid var(--c-line); color: var(--c-ink); cursor: pointer; text-align: left; font: 500 14px var(--c-body); }
.modal .wallets button:hover { border-color: #46464c; }
.modal .wallets img, .modal .wallets svg { width: 28px; height: 28px; }
.modal .empty { padding: 18px 0; color: var(--c-mute); font-size: 14px; text-align: center; border: 0; }
.modal .empty b { display: block; color: var(--c-ink); margin-bottom: 4px; }
.modal .btn { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--c-line2); background: transparent; color: var(--c-ink); font: 500 13.5px var(--c-body); cursor: pointer; box-shadow: none; }

/* ── phone and small tablets ── */
@media (max-width: 960px) {
  :root { --hdr: 58px; }
  .hdr { padding: 0 12px 0 16px; background: rgba(11, 11, 12, .86); }
  .hdr-l { flex: 1; gap: 10px; }
  .hdr-r { position: absolute; right: 60px; top: 0; height: var(--hdr); padding: 0; }
  .hdr-r .soc { display: none; }
  .openapp { height: 34px; padding: 0 14px; font-size: 13.5px; background: rgba(28, 28, 31, .8); }
  .hdr .burger { display: block; margin-left: auto; }
  .hdr .burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .hdr .burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
  .hdr .burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
  .hdr .nav { position: fixed; top: var(--hdr); left: 0; right: 0; height: calc(100svh - var(--hdr)); overflow-y: auto; overscroll-behavior: contain; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px 24px; background: #0b0b0c;
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s var(--c-ease), transform .2s var(--c-ease), visibility 0s .2s; }
  .hdr .nav.open { display: flex; opacity: 1; visibility: visible; transform: none; transition: opacity .2s var(--c-ease), transform .2s var(--c-ease); }
  .hdr .nav > a, .hdr .more > button { height: 48px; width: 100%; padding: 0 6px; font-size: 16px; color: var(--c-ink2); border-bottom: 1px solid #1a1a1d; }
  .navmark { left: auto; right: 8px; bottom: 23px; margin: 0; view-transition-name: none; }
  .hdr .more > button svg { display: none; }
  .hdr .drop { position: static; width: auto; max-height: none; overflow: visible; opacity: 1; visibility: visible; transform: none; background: transparent; border: 0; box-shadow: none; padding: 4px 0 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
  .hdr .drop a { padding: 9px 6px; }
  .hdr .nav-soc { display: flex; gap: 6px; padding: 12px 2px 0; }
  .hdr .nav-soc a { width: 40px; height: 40px; border: 1px solid var(--c-line); }
  .studio .hdr { display: flex; padding: 0 12px 0 16px; background: rgba(11, 11, 12, .86); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); pointer-events: auto; }
  .studio .hdr::after { display: block; }
  .studio .hdr-l { padding: 0; background: transparent; }
  .studio .hdr-l::after { display: none; }
  .studio .hdr-r { padding: 0; }
  .foot-in { padding: 26px 18px 28px; }
  .studio .foot { margin-left: calc(var(--gut) * -1); margin-right: calc(var(--gut) * -1); }
}
@media (prefers-reduced-motion: reduce) {
  .hdr *, .foot *, .toast { transition-duration: .01ms !important; }
}

[hidden] { display: none !important; }
