/* ARKANA — light grey desk, handwritten formulas, one screen. */
@font-face { font-family: 'Outfit'; src: url('/assets/fonts/outfit.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/assets/fonts/caveat.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
:root {
  --bg: #e2e2e2; --ink: #0c0c0c; --ink2: #3b3b3b; --mute: #6f6f6f; --dim: #9a9a9a; --line: rgba(0, 0, 0, .12); --line2: rgba(0, 0, 0, .2);
  --card: rgba(255, 255, 255, .78); --up: #149a4b; --down: #d23a3a; --warn: #b77a0c;
  --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif; --hand: 'Caveat', 'Comic Sans MS', cursive;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid #111; outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

/* stage: background, formulas, 3D */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(ellipse 70% 60% at 50% 38%, #ececec 0%, #e3e3e3 55%, #d6d6d6 100%); }
.stage__gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.stage .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: opacity .8s; }
.stage.has3d .still { opacity: 0; }
.formulas { position: absolute; inset: 0; z-index: 0; pointer-events: none; transition: transform .6s ease-out; }
.fx { position: absolute; font: 500 28px/1 var(--hand); color: #8d8d8d; white-space: nowrap; transform-origin: left center; clip-path: inset(0 100% 0 0); animation: write 1.4s cubic-bezier(.4, .1, .2, 1) forwards; }
.fx sub, .fx sup { font-size: .6em; }
.fx .frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1; margin: 0 .12em; }
.fx .frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 .1em .06em; }
@keyframes write { to { clip-path: inset(0 0 0 0); } }

/* header */
.top { position: fixed; z-index: 5; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 40px; pointer-events: none; }
.top > * { pointer-events: auto; }
.top__l { display: grid; gap: 10px; }
.brand { font: 400 19px/1 var(--sans); letter-spacing: .02em; }
.brand sup { font-size: 9px; vertical-align: top; margin-left: 1px; }
.top__sub { font: 500 10px/1 var(--sans); letter-spacing: .12em; color: var(--mute); transition: opacity 1s 2.4s; }
.top__r { display: flex; align-items: center; gap: 10px; }
.circ { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; transition: background .2s; }
.circ svg { width: 15px; height: 15px; }
.circ:hover { background: rgba(255, 255, 255, .6); }
.buy { font: 400 18px/1 var(--sans); padding: 8px 4px 8px 10px; }
.buy:hover { text-decoration: underline; text-underline-offset: 4px; }
.walletpill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); font: 500 13px var(--mono); }
.walletpill img { border-radius: 4px; }
.walletpill__out { font: 500 12px var(--sans); padding: 5px 10px; border-radius: 999px; background: #111; color: #fff; }

/* the chat column */
.desk { position: fixed; z-index: 4; left: 40px; bottom: 120px; width: min(560px, 46vw); max-height: calc(100vh - 220px); display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
.desk::before { content: ''; position: absolute; left: -120px; right: -140px; top: -80px; bottom: -60px; z-index: -1; background: radial-gradient(closest-side, rgba(230, 230, 230, .92), rgba(230, 230, 230, .7) 55%, rgba(230, 230, 230, 0)); pointer-events: none; }
.chat { pointer-events: auto; overflow-y: auto; scrollbar-width: none; padding-top: 8px; }
.chat::-webkit-scrollbar { display: none; }
.say { margin: 0; font: 400 clamp(26px, 2.45vw, 36px)/1.22 var(--sans); letter-spacing: -.01em; color: var(--ink); min-height: 1.2em; }
.say .w { display: inline-block; opacity: 0; filter: blur(6px); transform: translateY(4px); animation: word .38s ease-out forwards; }
@keyframes word { to { opacity: 1; filter: blur(0); transform: none; } }
.say.is-small { font-size: clamp(21px, 1.9vw, 28px); }
.chips { display: flex; flex-wrap: wrap; gap: 10px 8px; margin-top: 26px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; background: #fff; color: var(--ink); font: 400 15.5px/1 var(--sans); box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 6px 18px -10px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(8px); animation: chip .4s ease-out forwards; transition: background .2s, transform .2s; }
.chip:hover { background: #f7f7f7; transform: translateY(-1px); }
.chip--ghost { background: transparent; box-shadow: none; border: 1px solid var(--line2); }
.chip--dark { background: #111; color: #fff; }
.chip--dark:hover { background: #222; }
.chip .ext { opacity: .45; }
@keyframes chip { to { opacity: 1; transform: none; } }

/* answer cards */
.out:empty { display: none; }
.out { margin-top: 22px; }
.out .card:last-child { max-height: min(46vh, 420px); overflow-y: auto; scrollbar-width: thin; }
.card { background: var(--card); border: 1px solid rgba(255, 255, 255, .9); border-radius: 18px; padding: 16px 18px; box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .35); animation: cardin .45s ease-out; }
@keyframes cardin { from { opacity: 0; transform: translateY(10px); } }
.card + .card { margin-top: 10px; }
.card__h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin-bottom: 10px; }
.card__h em { font-style: normal; font-weight: 500; letter-spacing: .06em; text-transform: none; }
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; font: 400 14px var(--mono); outline: none; }
.ask input:focus { border-color: #111; }
.ask .chip { opacity: 1; transform: none; animation: none; }
.ask__err { color: var(--down); font-size: 13px; margin: 8px 4px 0; min-height: 1em; }
.hint { font-size: 12.5px; color: var(--mute); margin: 10px 4px 0; }
.rows { display: grid; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; min-width: 0; }
.row:first-child { border-top: 0; }
.row > span:first-child { color: var(--mute); flex: none; }
.row b { font-weight: 500; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .m { font-family: var(--mono); font-size: 13px; }
.row .sub { display: block; font-size: 11.5px; color: var(--dim); font-weight: 400; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--mute); }
.tag { display: inline-block; font: 600 9.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.tag--bad { background: rgba(210, 58, 58, .12); color: var(--down); } .tag--ok { background: rgba(20, 154, 75, .12); color: var(--up); } .tag--warn { background: rgba(183, 122, 12, .14); color: var(--warn); }
.score { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 8px; }
.score b { font: 300 56px/1 var(--sans); letter-spacing: -.04em; }
.score span { color: var(--mute); }
.meter { display: flex; gap: 3px; height: 8px; margin-bottom: 10px; }
.meter i { flex: 1; border-radius: 2px; background: rgba(0, 0, 0, .08); }
.meter i.on { background: #111; }
.load { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--mute); }
.load i { width: 16px; height: 16px; border: 2px solid rgba(0, 0, 0, .15); border-top-color: #111; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.revoke { font: 500 12px var(--sans); padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(210, 58, 58, .5); color: var(--down); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink2); }

/* caption, footer, CA, sound */
.caption { position: fixed; z-index: 3; left: 47.5%; bottom: 26px; transform: translateX(-50%); margin: 0; text-align: center; font: 400 15.5px/1.3 var(--sans); color: var(--ink); pointer-events: none; }
.foot { position: fixed; z-index: 4; left: 40px; bottom: 64px; display: flex; align-items: center; gap: 14px; }
.back { width: 34px; height: 34px; border-radius: 50%; background: #111; color: #fff; display: grid; place-items: center; }
.back svg { width: 14px; height: 14px; }
.built { font: 500 11px/1 var(--sans); letter-spacing: .2em; color: var(--mute); }
.built b { font-weight: 600; color: var(--ink2); }
.ca { position: fixed; z-index: 4; left: 40px; bottom: 18px; display: flex; align-items: center; gap: 10px; padding: 6px 14px; border: 1px dashed rgba(0, 0, 0, .3); border-radius: 999px; font: 400 13px var(--mono); background: rgba(226, 226, 226, .7); max-width: calc(100vw - 140px); }
.ca__k { font: 500 10px var(--sans); letter-spacing: .2em; color: var(--mute); }
.ca__addr { color: var(--ink); word-break: break-all; }
.ca.is-soon .ca__addr { color: var(--mute); }
.ca__copy { font: 400 12.5px var(--sans); color: var(--mute); text-decoration: underline; text-underline-offset: 3px; }
.ca__copy[disabled] { opacity: .4; text-decoration: none; cursor: default; }
.ca__copy.is-done { color: var(--up); }
.sound { position: fixed; z-index: 5; right: 40px; bottom: 40px; width: 40px; height: 80px; transition: transform .2s; }
.sound svg { width: 100%; height: 100%; }
.sound:hover { transform: translateY(-2px); }
.sound .sound__bar { transition: transform .3s; transform-origin: center; transform: scaleX(.4); }
.sound[aria-pressed=true] .sound__bar { transform: scaleX(1); animation: eq 1s ease-in-out infinite; }
@keyframes eq { 50% { transform: scaleX(.6); } }

/* dialogs */
.dlg { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; background: rgba(200, 200, 200, .55); backdrop-filter: blur(6px); padding: 20px; }
.dlg.is-open { display: flex; }
.dlg__box { width: 100%; max-width: 400px; background: #f6f6f6; border-radius: 22px; padding: 22px; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .45); }
.dlg__box h3 { margin: 0 0 6px; font: 500 21px var(--sans); }
.dlg__box p { margin: 0 0 18px; color: var(--mute); }
.dlg__box .chip { opacity: 1; transform: none; animation: none; }
.wsel__head { display: flex; justify-content: space-between; align-items: center; }
.wsel__x { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line2); font-size: 18px; line-height: 1; }
.wsel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wsel__list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #fff; text-align: left; }
.wsel__list button:hover { background: #fafafa; }
.wsel__list img { width: 30px; height: 30px; border-radius: 8px; }
.wsel__list b { flex: 1; font-weight: 500; }
.wsel__list small { font: 600 10px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.wsel__list small.det { color: var(--up); }
.wsel__foot { font-size: 13px; margin: 14px 0 0 !important; }
.wsel__foot a { text-decoration: underline; }
.wsel__err { color: var(--down); font-size: 13px; margin: 6px 0 0; }
.toast { position: fixed; left: 50%; bottom: 90px; z-index: 40; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 999px; background: #111; color: #fff; font-size: 14px; transition: opacity .25s, transform .25s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* phones: the agent sits at the top, the chat fills the bottom half */
@media (max-width: 760px), (max-aspect-ratio: 85/100) {
  body { overflow: hidden; }
  .top { padding: 14px 16px; }
  .top__sub { display: none; }
  .buy { font-size: 15px; }
  .circ { width: 32px; height: 32px; }
  .desk { left: 16px; right: 16px; width: auto; bottom: 108px; top: 42vh; max-height: none; }
  .out .card:last-child { max-height: 34vh; }
  .say { font-size: 21px; }
  .desk::before { left: -40px; right: -40px; }
  .say.is-small { font-size: 19px; }
  .chips { gap: 8px 6px; margin-top: 18px; }
  .chip { height: 38px; padding: 0 15px; font-size: 14px; }
  .caption { display: none; }
  .foot { left: 16px; bottom: 58px; } .built { font-size: 9.5px; }
  .ca { left: 16px; right: 70px; bottom: 14px; font-size: 11px; padding: 6px 10px; }
  .sound { right: 16px; bottom: 14px; width: 30px; height: 60px; }
  .walletpill span#wpAddr { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fx { animation: none; clip-path: none; } .say .w, .chip { animation: none; opacity: 1; filter: none; transform: none; } }
