/* ---------- logo mark (inline SVG from scripts/make-logo.mjs) ---------- */
.mark { display: block; overflow: visible; }
.mark line { stroke-linecap: round; transform-box: view-box; transform-origin: 24px 24px; }
.mark .f { stroke: #d9781f; stroke-width: 1.15; }
.mark .f.hi { stroke: #f6b54e; }
.mark .r { stroke: var(--ink); stroke-width: .9; }
.mark .rays, .mark .fibres { transform-box: view-box; transform-origin: 24px 24px; }
.mark .rays { animation: spin 28s linear infinite; }
.mark .fibres { animation: spin 46s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand { display: inline-flex; align-items: center; gap: 9px; font: 600 15px var(--mono); letter-spacing: .06em; }
.brand .mark { width: 30px; height: 30px; transition: transform .6s cubic-bezier(.2, .9, .2, 1); }
.brand:hover .mark { transform: rotate(-30deg) scale(1.08); }
.brand:hover .rays { animation-duration: 4s; }
.ver { top: calc(var(--gut) + 38px) !important; }

/* intro: the mark assembles from scattered fibres, like the reference ring forming */
.intro-mark .mark { width: clamp(70px, 9vw, 110px); height: clamp(70px, 9vw, 110px); }
.mark.assemble line { animation: assemble 1.4s cubic-bezier(.2, .9, .2, 1) both; animation-delay: calc(var(--i) * 18ms); }
.mark.assemble .r { animation-delay: calc(500ms + var(--i) * 22ms); }
@keyframes assemble {
  from { opacity: 0; transform: rotate(calc(var(--i) * 7deg + 60deg)) scale(2.4); }
}

/* ---------- account controls in the frame ---------- */
.chrome { gap: 22px; }
.acct { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.acct + .nav { margin-left: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; font: 500 12px var(--mono); cursor: pointer; border: 1px solid var(--ink); background: transparent; color: var(--ink); transition: background .25s, color .25s, transform .25s; white-space: nowrap; }
.chip:hover { transform: translateY(-1px); }
.chip.solid { background: var(--ink); color: var(--bg-1); }
.chip.solid:hover { background: transparent; color: var(--ink); }
.chip.ghost:hover { background: rgba(255, 255, 255, .4); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.on .dot { background: #3aa45a; box-shadow: 0 0 0 3px rgba(58, 164, 90, .18); }
.chip img { width: 22px; height: 22px; border-radius: 50%; margin-left: -8px; object-fit: cover; background: #bbb; }
.chip.me { padding-left: 8px; }

/* ---------- sign-in dialog ---------- */
.modal { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 26px; padding: 34px 30px 24px; background: #ecebe8; color: var(--ink); box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .55); text-align: center; }
.modal::backdrop { background: rgba(30, 28, 25, .35); }
.modal[open] { animation: pop .5s cubic-bezier(.2, .9, .2, 1); }
.modal[open]::backdrop { animation: fade .4s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes fade { from { opacity: 0; } }
.modal-x { position: absolute; right: 14px; top: 14px; margin: 0; }
.modal-x button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: none; cursor: pointer; color: var(--ink-2); }
.modal-mark .mark { width: 64px; height: 64px; margin: 0 auto 12px; }
.modal h2 { margin: 0; font: 500 28px var(--sans); letter-spacing: -.02em; }
.modal-sub { margin: 6px auto 22px; max-width: 30ch; font-size: 14px; color: var(--ink-2); }
.providers, .wallets { display: grid; gap: 8px; }
.prov { position: relative; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: #f7f6f4; font: 500 14.5px var(--sans); color: var(--ink); cursor: pointer; transition: border-color .2s, transform .2s, background .2s; }
.prov:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-1px); }
.prov svg, .prov img { width: 20px; height: 20px; flex: none; border-radius: 5px; }
.prov i { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; display: none; }
.prov:disabled { cursor: not-allowed; opacity: .55; }
.prov:disabled i { display: inline; }
.prov.busy::after { content: ""; position: absolute; right: 16px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ember); border-right-color: transparent; animation: spin .7s linear infinite; }
.or { position: relative; margin: 16px 0; font-size: 11px; color: var(--muted); }
.or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { position: relative; background: #ecebe8; padding: 0 10px; }
.modal-note { margin: 16px 0 0; font-size: 11px; color: var(--muted); }
.modal-note.err { color: #b3361b; }

/* ---------- account menu ---------- */
.menu { position: fixed; z-index: 30; right: var(--gut); top: calc(var(--gut) + 44px); width: 280px; border-radius: 18px; background: #ecebe8; box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .5); padding: 14px; animation: pop .35s cubic-bezier(.2, .9, .2, 1); }
.menu[hidden] { display: none; }
.menu-head { display: flex; gap: 10px; align-items: center; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); }
.menu-head img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #c9c9c9; }
.menu-head b { display: block; font-weight: 500; }
.menu-head small { font-size: 10.5px; color: var(--muted); }
.menu-list { display: grid; gap: 2px; padding: 8px 0; }
.menu-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; font-size: 13.5px; }
.menu-row svg { width: 16px; height: 16px; flex: none; }
.menu-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row small { font: 11px var(--mono); color: var(--muted); }
.menu-row button { font: 500 11px var(--mono); border: 1px solid var(--line); background: none; border-radius: 999px; padding: 4px 10px; cursor: pointer; color: var(--ink); }
.menu-row button:hover { border-color: var(--ink); }
.menu-row button:disabled { opacity: .45; cursor: not-allowed; }
.menu-out { width: 100%; padding: 10px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; font-size: 12px; color: var(--ink-2); }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%); background: #141414; color: #f1efea; font-size: 12px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .6); animation: pop .35s cubic-bezier(.2, .9, .2, 1); }
.toast[hidden] { display: none; }

@media (max-width: 760px) {
  .chrome { flex-wrap: wrap; row-gap: 10px; }
  .acct { order: 3; width: 100%; margin-left: 0; }
  .nav { display: none; }
  .chip { height: 32px; padding: 0 12px; }
  .ver { display: none; }
  .menu { left: var(--gut); right: var(--gut); width: auto; top: calc(var(--gut) + 86px); }
}
@media (prefers-reduced-motion: reduce) {
  .mark .rays, .mark .fibres, .mark.assemble line { animation: none !important; }
}

/* "hidden" must win over the grid/flex display rules above */
.providers[hidden], .or[hidden] { display: none !important; }
