/* QWIRE — grammar measured from phantom.com (rounded media hero, pill nav, 400-weight display 80/88 -2px,
   tall rounded feature cards); own DNA: paper + ink, one ultramarine accent, Instrument Sans + JetBrains Mono. */
:root {
  --paper: #F3F2EE;
  --surface: #FFFFFF;
  --surface-2: #ECEBE6;
  --ink: #111113;
  --ink-80: rgba(17, 17, 19, .8);
  --ink-60: rgba(17, 17, 19, .58);
  --ink-40: rgba(17, 17, 19, .4);
  --line: rgba(17, 17, 19, .08);
  --line-2: rgba(17, 17, 19, .14);
  --accent: #2E3BFF;
  --accent-hover: #4350FF;
  --accent-soft: #E3E5FF;
  --night: #0E0E12;
  --on-night: #F5F4F0;
  --on-night-60: rgba(245, 244, 240, .62);
  --r-hero: 28px; --r-card: 24px; --r-panel: 18px; --r-ctl: 12px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: 48px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "ss01"; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img, video, svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 30; padding: 24px 0 0; transition: padding .2s var(--ease); }
.nav-in { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 22px; letter-spacing: -0.04em; justify-self: start; }
.logo svg { width: 26px; height: 26px; }
.pillnav { display: flex; align-items: center; gap: 2px; height: 56px; padding: 0 8px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: var(--r-pill); box-shadow: 0 0 0 1px var(--line); }
.pillnav a { height: 40px; padding: 0 18px; display: inline-flex; align-items: center; border-radius: var(--r-pill); color: var(--ink-80); font-size: 16px; transition: background-color .16s var(--ease), color .16s var(--ease); }
.pillnav a:hover { background: var(--surface-2); color: var(--ink); }
.pillnav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.nav-r { justify-self: end; display: flex; gap: 8px; align-items: center; }

.btn { height: 52px; padding: 0 26px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; transition: background-color .16s var(--ease), color .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease); }
.btn:active { transform: scale(.98); }
.btn-sm { height: 44px; padding: 0 20px; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: #D6D9FF; }
.btn-light { background: var(--on-night); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn-line { box-shadow: inset 0 0 0 1px var(--line-2); background: var(--surface); }
.btn-line:hover { box-shadow: inset 0 0 0 1px rgba(17, 17, 19, .28); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- hero ---------- */
.hero { margin-top: 24px; position: relative; height: min(900px, calc(100vh - 104px)); min-height: 720px; border-radius: var(--r-hero); overflow: hidden; background: var(--night); color: var(--on-night); display: flex; flex-direction: column; align-items: center; }
.hero-in { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px var(--s6) 0; flex: none; }
.kicker { font-size: 24px; line-height: 32px; letter-spacing: -0.025em; color: var(--on-night-60); }
.h1 { margin: 16px 0 0; font-weight: 400; font-size: 80px; line-height: 84px; letter-spacing: -0.025em; max-width: 14ch; text-wrap: balance; }
.hero .btn { margin-top: 36px; }
.shot { margin: 56px 0 0; width: min(1160px, calc(100% - 96px)); flex: none; border-radius: 22px 22px 0 0; overflow: hidden; box-shadow: 0 0 0 8px rgba(245, 244, 240, .06), 0 40px 80px rgba(0, 0, 0, .45); animation: rise .9s var(--ease) .1s both; }
.shot img { width: 100%; height: auto; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
.hero-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: space-between; padding: 18px 28px; font: 400 13px/1 var(--mono); color: var(--on-night-60); background: linear-gradient(0deg, rgba(14, 14, 18, .92), rgba(14, 14, 18, 0)); padding-top: 48px; }
.hero-foot b { color: var(--on-night); font-weight: 400; }

/* ---------- sections ---------- */
.sec { padding: var(--s10) 0 0; }
.h2 { margin: 0; font-weight: 400; font-size: 72px; line-height: 76px; letter-spacing: -0.03em; text-wrap: balance; }
.h3 { margin: 0; font-weight: 400; font-size: 24px; line-height: 32px; letter-spacing: -0.025em; }
.lead { margin: 20px 0 0; font-size: 20px; line-height: 28px; color: var(--ink-60); max-width: 34ch; letter-spacing: -0.01em; }
.label { font: 400 13px/16px var(--mono); color: var(--ink-40); letter-spacing: 0; }

/* live encryption */
.lab { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s6); align-items: start; }
.lab-copy { position: sticky; top: 120px; padding-top: var(--s4); }
.lab-copy .facts { margin-top: var(--s7); display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts span { color: var(--ink-60); }
.panel { background: var(--surface); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--line); }
.lab-card { padding: var(--s5); }
.compose { display: grid; grid-template-columns: 1fr 140px; gap: var(--s3); }
.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; color: var(--ink-60); }
.input { width: 100%; height: 52px; padding: 0 16px; border-radius: var(--r-ctl); border: 0; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; transition: box-shadow .16s var(--ease), background-color .16s var(--ease); }
.input:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.input:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
textarea.input { height: auto; min-height: 96px; padding: 14px 16px; resize: none; line-height: 1.5; }
.input-sol { position: relative; }
.input-sol .input { padding-right: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.input-sol::after { content: "SOL"; position: absolute; right: 16px; top: 0; height: 52px; display: flex; align-items: center; font-size: 13px; color: var(--ink-40); pointer-events: none; }
.wire { margin-top: var(--s5); border-radius: var(--r-panel); background: var(--night); color: var(--on-night); padding: var(--s5); overflow: hidden; }
.wire-top { display: flex; justify-content: space-between; align-items: baseline; font: 400 12px/1 var(--mono); color: var(--on-night-60); }
.wire-top b { color: var(--on-night); font-weight: 400; }
.hexgrid { margin-top: 18px; font: 400 11.5px/17px var(--mono); color: rgba(245, 244, 240, .34); word-break: break-all; height: 204px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.hexgrid .k { color: rgba(159, 167, 255, .9); }
.hexgrid .n { color: rgba(245, 244, 240, .9); }
.hexgrid .c { color: rgba(245, 244, 240, .58); }
.legend { display: flex; gap: 18px; margin-top: 14px; font: 400 12px/1 var(--mono); color: var(--on-night-60); flex-wrap: wrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.txs { margin-top: var(--s4); display: grid; gap: 8px; }
.tx { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-ctl); background: var(--paper); font-size: 14px; }
.tx .i { font: 400 12px var(--mono); color: var(--ink-40); }
.tx .m { font: 400 12px var(--mono); color: var(--ink-60); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .b { font: 400 12px var(--mono); color: var(--ink-60); }
.tx.pay .i { color: var(--accent); }

/* feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); margin-top: var(--s7); }
.fcard { position: relative; height: 560px; border-radius: var(--r-card); padding: var(--s6); overflow: hidden; display: flex; flex-direction: column; }
.fcard .h3 { max-width: 14ch; }
.fcard.ink { background: var(--night); color: var(--on-night); }
.fcard.blue { background: var(--accent); color: #fff; }
.fcard.stone { background: var(--surface-2); }
.fcard .art { margin-top: auto; }
.bubble { max-width: 82%; padding: 12px 16px; border-radius: 20px; font-size: 15px; line-height: 1.4; }
.bubble.me { margin-left: auto; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { background: rgba(245, 244, 240, .1); color: var(--on-night); border-bottom-left-radius: 6px; }
.bubble + .bubble { margin-top: 8px; }
.meta { margin-top: 8px; font: 400 11px var(--mono); color: var(--on-night-60); }
.meta.r { text-align: right; }
.paycard { background: #fff; color: var(--ink); border-radius: 20px; padding: 20px; }
.paycard .amt { font-size: 48px; line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.paycard .amt small { font-size: 20px; color: var(--ink-40); margin-left: 6px; letter-spacing: -0.01em; }
.paycard .row { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-60); }
.paycard .ok { color: var(--accent); }
.years { display: grid; gap: 10px; }
.year { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; background: #fff; border-radius: 16px; font-size: 15px; }
.year .y { font-variant-numeric: tabular-nums; color: var(--ink-60); }
.year .s { font: 400 12px var(--mono); }
.year .s.bad { color: var(--ink-40); text-decoration: line-through; }

/* protocol spec */
.spec { margin-top: var(--s7); display: grid; grid-template-columns: repeat(3, 1fr); }
.spec > div { padding: var(--s6) var(--s6) var(--s6) 0; border-top: 1px solid var(--line-2); }
.spec .v { margin-top: 18px; font-size: 32px; line-height: 36px; letter-spacing: -0.03em; }
.spec p { margin: 10px 0 0; color: var(--ink-60); font-size: 15px; max-width: 32ch; }

/* close + footer */
.close { padding: var(--s10) 0; text-align: center; }
.close .h2 { font-size: 96px; line-height: 100px; letter-spacing: -0.035em; }
.close .btn { margin-top: var(--s6); }
.close .sub { color: var(--ink-60); font-size: 20px; margin-bottom: 20px; }
.foot { margin-top: var(--s7); border-top: 1px solid var(--line); padding: var(--s6) 0 var(--s7); display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--ink-60); }
.foot nav { display: flex; gap: var(--s5); }
.foot a:hover { color: var(--ink); }

/* doc pages */
.doc { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s8); padding: var(--s9) 0 var(--s9); }
.toc { position: sticky; top: 120px; align-self: start; display: grid; gap: 2px; }
.toc a { padding: 8px 14px; border-radius: 10px; color: var(--ink-60); font-size: 15px; transition: background-color .16s var(--ease), color .16s var(--ease); }
.toc a:hover { background: var(--surface-2); color: var(--ink); }
.doc h1 { margin: 0; font-weight: 400; font-size: 64px; line-height: 68px; letter-spacing: -0.03em; }
.doc .intro { font-size: 20px; line-height: 30px; color: var(--ink-60); margin: 20px 0 0; max-width: 44ch; }
.doc h2 { margin: var(--s8) 0 0; font-weight: 400; font-size: 32px; line-height: 38px; letter-spacing: -0.025em; scroll-margin-top: 120px; }
.doc p, .doc li { font-size: 17px; line-height: 28px; color: var(--ink-80); max-width: 64ch; }
.doc li + li { margin-top: 6px; }
.doc code { font: 400 14px var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.codeblock { margin: 20px 0 0; padding: 20px 24px; background: var(--night); color: var(--on-night); border-radius: var(--r-panel); font: 400 13px/22px var(--mono); white-space: pre; overflow-x: auto; }
.codeblock .c { color: var(--on-night-60); }
.tbl { margin-top: 20px; width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font: 400 12px var(--mono); color: var(--ink-40); padding: 0 16px 12px 0; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { white-space: nowrap; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; }
.tag.yes { background: var(--accent-soft); color: var(--accent); }
.tag.no { background: var(--surface-2); color: var(--ink-60); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  :root { --gutter: 24px; }
  .h1 { font-size: 60px; line-height: 64px; }
  .h2 { font-size: 52px; line-height: 56px; }
  .lab { grid-template-columns: 1fr; }
  .lab-copy { position: static; }
  .cards { grid-template-columns: 1fr; }
  .fcard { height: 480px; }
  .spec { grid-template-columns: 1fr 1fr; }
  .doc { grid-template-columns: 1fr; }
  .toc { display: none; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .nav { padding-top: 12px; }
  .nav-in { grid-template-columns: auto 1fr; }
  .pillnav { display: none; }
  .hero { margin-top: 12px; border-radius: 22px; min-height: 0; height: calc(100svh - 84px); }
  .hero-in { padding-top: 56px; }
  .shot { margin-top: 40px; width: calc(100% - 40px); border-radius: 18px 18px 0 0; }
  .kicker { font-size: 18px; }
  .h1 { font-size: 44px; line-height: 48px; }
  .hero-foot { font-size: 11px; padding: 18px 20px; }
  .sec { padding-top: var(--s9); }
  .h2 { font-size: 40px; line-height: 44px; }
  .close .h2 { font-size: 52px; line-height: 56px; }
  .compose { grid-template-columns: 1fr; }
  .spec { grid-template-columns: 1fr; }
  .foot { flex-direction: column; gap: var(--s4); align-items: flex-start; }
  .doc h1 { font-size: 44px; line-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }
