/* QUILLHOUSE — design system shared by every page (header, footer, buttons, type, modals, wallet, toast).
   Page-specific styles live in home.css / app.css / token.css. */
@font-face { font-family: 'Newsreader'; src: url('/assets/fonts/newsreader-normal-300-600.woff2') format('woff2'); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('/assets/fonts/newsreader-italic-300-600.woff2') format('woff2'); font-weight: 300 600; font-style: italic; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/instrument-sans-normal-400-600.woff2') format('woff2'); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/ibm-plex-mono-normal-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/ibm-plex-mono-normal-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --night: #13141d; --night-2: #181926; --night-3: #1e2030; --panel: #232539; --panel-2: #2b2e47; --panel-3: #33375a;
  --line: rgba(236, 235, 250, .11); --line-2: rgba(236, 235, 250, .2); --line-3: rgba(236, 235, 250, .34);
  --ink: #ecebf6; --ink-2: #c9c8dc; --mute: #9b9ab2; --dim: #6f6e88;
  --peri: #8e95e8; --peri-2: #b9bdf4; --peri-dim: rgba(142, 149, 232, .16);
  --cream: #f2efe7; --cream-2: #e7e3d8; --cream-ink: #16171f;
  --ember: #e2583f;
  --mist-0: #dfe4f1; --mist-1: #c8d0e7; --mist-2: #a9b6da; --mist-ink: #1c1f35; --mist-mute: #586081; --mist-line: rgba(28, 31, 53, .14);
  --good: #7fd3a9; --good-dim: rgba(127, 211, 169, .16); --warn: #ebc36d; --warn-dim: rgba(235, 195, 109, .16); --bad: #f0806f; --bad-dim: rgba(240, 128, 111, .16);
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-xs: 6px; --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --wrap: 1120px; --gut: 32px; --hdr: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: rgba(142, 149, 232, .45); color: #fff; }
:focus-visible { outline: 2px solid var(--peri-2); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--cream); color: var(--cream-ink); padding: 8px 14px; border-radius: var(--r-xs); }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gut) * 2); margin: 0 auto; padding: 0 var(--gut); }
.wrap--wide { max-width: calc(1320px + var(--gut) * 2); }

/* ---------- type ---------- */
.display { font: 400 clamp(44px, 6.4vw, 84px)/1.02 var(--serif); letter-spacing: -.022em; font-optical-sizing: auto; }
.h1 { font: 400 clamp(40px, 5vw, 64px)/1.05 var(--serif); letter-spacing: -.02em; }
.h2 { font: 400 clamp(32px, 3.8vw, 50px)/1.08 var(--serif); letter-spacing: -.018em; }
.h3 { font: 500 clamp(21px, 1.9vw, 25px)/1.22 var(--sans); letter-spacing: -.01em; }
.display em, .h1 em, .h2 em { font-style: italic; font-weight: 300; }
.lede { font-size: clamp(17px, 1.45vw, 19.5px); line-height: 1.55; color: var(--ink-2); }
.mut { color: var(--mute); }
.mono-k { font: 400 12px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.kicker { display: inline-flex; align-items: center; gap: 12px; font: 400 12px/1.4 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); }
.kicker::after { content: ''; width: 56px; height: 1px; background: currentColor; opacity: .5; }
.kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px rgba(226, 88, 63, .18); }
.kicker--pre::after { display: none; }
.kicker--pre::before { content: ''; width: 34px; height: 1px; background: currentColor; opacity: .5; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons + links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: var(--r-xs); background: var(--cream); color: var(--cream-ink); font: 500 15.5px/1 var(--sans); letter-spacing: -.005em; border: 1px solid var(--cream); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 8px 24px -10px rgba(0, 0, 0, .55); transition: background .2s, transform .2s var(--ease), box-shadow .2s; white-space: nowrap; }
.btn:hover { background: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--line { background: transparent; color: var(--ink); border-color: var(--line-3); box-shadow: none; }
.btn--line:hover { background: rgba(236, 235, 250, .08); border-color: var(--ink-2); }
.btn--ink { background: var(--cream-ink); color: var(--cream); border-color: var(--cream-ink); box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .6); }
.btn--ink:hover { background: #24263a; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 24px; font-size: 16.5px; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.alink { display: inline-flex; align-items: center; gap: 12px; font: 500 15px/1.3 var(--sans); padding-bottom: 6px; border-bottom: 1px solid currentColor; }
.alink .ar { font-size: 15px; transition: transform .25s var(--ease); }
.alink:hover .ar { transform: translate(2px, -2px); }

/* ---------- header ---------- */
.hdr { position: fixed; top: 0; left: 0; right: 0; z-index: 90; height: var(--hdr); color: var(--ink); transition: background .35s, color .35s, border-color .35s, box-shadow .35s; border-bottom: 1px solid transparent; }
.hdr.is-solid { background: rgba(19, 20, 31, .9); border-bottom-color: var(--line); }
.hdr.is-light { background: rgba(242, 239, 231, .94); color: var(--cream-ink); border-bottom-color: rgba(22, 23, 31, .1); }
.hdr__in { height: 100%; display: flex; align-items: center; gap: 24px; max-width: none; padding: 0 32px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.brand svg { width: 30px; height: 30px; }
.brand b { font: 600 14.5px/1 var(--sans); letter-spacing: .34em; padding-left: 2px; }
.nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.nav__item { position: relative; }
.nav__top { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; font: 400 15px/1 var(--sans); border-radius: var(--r-xs); opacity: .92; }
.nav__top:hover, .nav__item:focus-within .nav__top { opacity: 1; }
.nav__top svg { width: 10px; height: 10px; transition: transform .25s; }
.nav__item:hover .nav__top svg, .nav__item:focus-within .nav__top svg { transform: rotate(180deg); }
.nav__top[aria-current] { text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 1px; }
.nav__panel { position: absolute; left: 50%; top: calc(100% + 4px); min-width: 320px; transform: translate(-50%, 6px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); background: #1c1d2c; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); }
.nav__item:hover .nav__panel, .nav__item:focus-within .nav__panel { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.nav__panel::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav__panel a { display: grid; grid-template-columns: 34px 1fr; gap: 2px 12px; padding: 11px 12px; border-radius: var(--r-sm); }
.nav__panel a:hover { background: rgba(236, 235, 250, .07); }
.nav__panel i { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--peri-2); font-style: normal; }
.nav__panel i svg { width: 16px; height: 16px; }
.nav__panel b { font: 500 14.5px/1.3 var(--sans); }
.nav__panel span { font-size: 13px; color: var(--mute); line-height: 1.35; }
.hdr__end { display: flex; align-items: center; gap: 12px; flex: none; }
.hdr .btn--line { color: inherit; border-color: currentColor; }
.hdr.is-light .btn--line:hover { background: rgba(22, 23, 31, .06); }
.hdr.is-light .btn:not(.btn--line) { background: var(--cream-ink); color: var(--cream); border-color: var(--cream-ink); box-shadow: 0 8px 22px -10px rgba(22, 23, 31, .5); }
.icobtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-xs); opacity: .85; }
.icobtn:hover { opacity: 1; background: rgba(236, 235, 250, .08); }
.icobtn svg { width: 17px; height: 17px; }
.menu { display: none; width: 42px; height: 42px; border-radius: var(--r-xs); position: relative; }
.menu span, .menu span::before, .menu span::after { position: absolute; left: 11px; width: 20px; height: 1.5px; background: currentColor; content: ''; transition: transform .3s, top .3s, opacity .3s; }
.menu span { top: 20px; } .menu span::before { left: 0; top: -6px; } .menu span::after { left: 0; top: 6px; }
.hdr.is-open .menu span { background: transparent; }
.hdr.is-open .menu span::before { top: 0; transform: rotate(45deg); }
.hdr.is-open .menu span::after { top: 0; transform: rotate(-45deg); }

/* wallet pill in the header */
.who { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 10px; border: 1px solid currentColor; border-radius: var(--r-xs); font: 500 13.5px/1 var(--mono); position: relative; }
.who img { width: 20px; height: 20px; border-radius: 5px; }
.who .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-dim); }
.who.is-wrong .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-dim); }
.drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: #1c1d2c; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .7); z-index: 95; }
.drop a, .drop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); font: 400 14.5px/1.2 var(--sans); color: var(--ink-2); text-align: left; }
.drop a:hover, .drop button:hover { background: rgba(236, 235, 250, .07); color: var(--ink); }
.drop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.drop .drop__addr { padding: 10px 12px 8px; font: 400 12px/1.45 var(--mono); color: var(--mute); word-break: break-all; }

/* ---------- footer ---------- */
.ftr { position: relative; background: var(--night); border-top: 1px solid var(--line); padding: 84px 0 40px; overflow: hidden; }
.ftr__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 40px; }
.ftr__brand p { margin-top: 18px; font-size: 14px; color: var(--mute); max-width: 34ch; line-height: 1.6; }
.ftr h4 { font: 400 11.5px/1.3 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); margin-bottom: 18px; }
.ftr li + li { margin-top: 11px; }
.ftr li a { font-size: 14.5px; color: var(--ink-2); }
.ftr li a:hover { color: var(--ink); }
.ftr__word { margin-top: 72px; font: 300 clamp(64px, 15vw, 216px)/.86 var(--serif); letter-spacing: -.035em; color: transparent; -webkit-text-stroke: 1px rgba(236, 235, 250, .16); white-space: nowrap; user-select: none; }
.ftr__word em { font-style: italic; }
.ftr__base { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; font-size: 13px; color: var(--dim); }
.ftr__base p { max-width: 80ch; }
.ftr__social { display: flex; gap: 6px; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 20px; background: rgba(8, 9, 14, .72); opacity: 0; pointer-events: none; transition: opacity .22s; }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal__box { width: 100%; max-width: 460px; max-height: min(760px, calc(100vh - 40px)); display: flex; flex-direction: column; background: #1b1c2a; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .8); transform: translateY(12px) scale(.985); transition: transform .3s var(--ease); overflow: hidden; }
.modal.is-open .modal__box { transform: none; }
.modal__box--sm { max-width: 400px; }
.modal__box--wide { max-width: 640px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal__head h3 { font: 400 24px/1.15 var(--serif); letter-spacing: -.01em; }
.modal__x { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--mute); flex: none; }
.modal__x:hover { background: rgba(236, 235, 250, .08); color: var(--ink); }
.modal__body { padding: 22px; overflow-y: auto; }
.modal__body > * + * { margin-top: 12px; }
.modal__foot { padding: 14px 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); line-height: 1.5; }
.wlist { display: grid; gap: 8px; }
.wbtn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255, 255, 255, .025); text-align: left; font-size: 15.5px; transition: border-color .15s, background .15s; }
.wbtn:hover { border-color: var(--peri); background: rgba(142, 149, 232, .08); }
.wbtn img { width: 32px; height: 32px; border-radius: 8px; }
.wbtn em { margin-left: auto; font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; font-style: normal; color: var(--mute); }
.wbtn em.det { color: var(--good); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 160; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: var(--r); background: var(--cream); color: var(--cream-ink); font: 500 14.5px/1.35 var(--sans); box-shadow: 0 18px 44px -12px rgba(0, 0, 0, .7); transition: opacity .2s, transform .25s var(--ease); max-width: calc(100vw - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal (CSS fallback; GSAP drives it when present) ---------- */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.is-in { opacity: 1; transform: none; }
.rv.d1 { transition-delay: .08s; } .rv.d2 { transition-delay: .16s; } .rv.d3 { transition-delay: .24s; } .rv.d4 { transition-delay: .32s; } .rv.d5 { transition-delay: .4s; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- small shared pieces ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-2); font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.tag--good { color: var(--good); border-color: rgba(127, 211, 169, .35); background: var(--good-dim); }
.tag--warn { color: var(--warn); border-color: rgba(235, 195, 109, .35); background: var(--warn-dim); }
.tag--bad { color: var(--bad); border-color: rgba(240, 128, 111, .35); background: var(--bad-dim); }
.sk { display: inline-block; height: 12px; width: 60%; border-radius: 4px; background: linear-gradient(90deg, rgba(236, 235, 250, .06), rgba(236, 235, 250, .14), rgba(236, 235, 250, .06)); background-size: 200% 100%; animation: sk 1.3s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav { display: none; position: fixed; left: 0; right: 0; top: var(--hdr); bottom: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 18px 24px 40px; background: var(--night); color: var(--ink); overflow-y: auto; margin: 0; }
  .hdr.is-open .nav { display: flex; }
  .hdr.is-open { background: var(--night); color: var(--ink); }
  .nav__item { border-bottom: 1px solid var(--line); }
  .nav__top { height: 54px; padding: 0; font-size: 18px; width: 100%; justify-content: space-between; }
  .nav__panel { position: static; transform: none; opacity: 1; pointer-events: auto; background: none; border: 0; box-shadow: none; padding: 0 0 12px; min-width: 0; display: none; }
  .nav__item.is-open .nav__panel { display: block; }
  .nav__item:hover .nav__panel { transform: none; }
  .nav__mob { display: flex !important; gap: 10px; margin-top: 22px; }
  .menu { display: block; }
  .hdr__end .hide-m { display: none; }
  .ftr__grid { grid-template-columns: 1fr 1fr; }
  .ftr__brand { grid-column: 1 / -1; }
}
@media (min-width: 1081px) { .nav__mob { display: none !important; } }
@media (max-width: 640px) {
  :root { --gut: 16px; --hdr: 60px; }
  .hdr__in { padding: 0 16px; gap: 10px; }
  .brand b { font-size: 13px; letter-spacing: .26em; }
  .brand svg { width: 26px; height: 26px; }
  .hdr__end .btn { height: 38px; padding: 0 12px; font-size: 14px; }
  .who { height: 38px; padding: 0 10px 0 8px; font-size: 12.5px; }
  .ftr { padding: 60px 0 32px; }
  .ftr__grid { gap: 30px 20px; }
}
@media (max-width: 380px) { .brand b { display: none; } }
