:root {
  /* old Twitter palette: blue #1DA1F2, ink #14171A, greys #657786 / #AAB8C2 / #E1E8ED / #F5F8FA */
  --blue: #1da1f2;
  --ink: #14171a;
  --bg: #ffffff;
  --bg2: #f5f8fa;
  --line: rgba(20, 23, 26, .1);
  --line2: rgba(20, 23, 26, .24);
  --text: #14171a;
  --muted: #657786;
  --dim: #aab8c2;
  --acc: #1da1f2;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gut: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans); font-weight: 300;
  font-size: 16px; line-height: 1.55; overflow-x: clip;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--blue); color: #fff; }

/* blue chapters: same components, inverted tokens */
.blue, .nav:not(.solid) {
  --bg: #1da1f2; --bg2: #1a94e0;
  --line: rgba(255, 255, 255, .3); --line2: rgba(255, 255, 255, .6);
  --text: #ffffff; --muted: rgba(255, 255, 255, .88); --dim: rgba(255, 255, 255, .62);
  --acc: #ffffff;
  color: var(--text);
}
.blue { background: var(--bg); }

.mono { font-family: var(--mono); font-weight: 400; letter-spacing: .02em; }
.dim { color: var(--dim); }
h2 .dim { color: var(--acc); }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 var(--gut); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }

h1, h2 { font-weight: 300; letter-spacing: -.035em; line-height: .98; }
h1 { font-size: clamp(52px, 9.2vw, 148px); }
h2 { font-size: clamp(38px, 5.6vw, 84px); margin: 18px 0 28px; }
.kicker { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.body { color: var(--muted); font-size: clamp(16px, 1.25vw, 19px); max-width: 32em; margin-bottom: 32px; }
.body.narrow { max-width: 26em; }
.label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }

/* buttons: thin outline, square corners */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px;
  border: 1px solid var(--line2); font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
  transition: border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
  will-change: transform;
}
.btn:hover { border-color: var(--text); }
.btn.solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.solid:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.small { height: 34px; padding: 0 14px; font-size: 12px; }
.btn i { font-style: normal; transition: transform .3s var(--ease); }
.btn:hover i { transform: translate(2px, -2px); }

/* scroll progress */
.bar { position: fixed; inset: 0 0 auto 0; height: 1px; z-index: 60; }
.bar { height: 2px; }
.bar span { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 var(--gut);
  transition: transform .45s var(--ease), background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.solid { background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.nav.hide { transform: translateY(-100%); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 18px; letter-spacing: -.02em; }
.brand em { font-style: normal; color: var(--dim); }
.mark { width: 34px; height: 24px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: square; }
.mark .sig { stroke: var(--acc); }
.links { display: flex; gap: 30px; font-size: 14px; color: var(--muted); }
.links a { position: relative; transition: color .25s; }
.links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--text); transform: scaleX(0); transform-origin: 100% 50%; transition: transform .35s var(--ease); }
.links a:hover { color: var(--text); }
.links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

/* sticky chapters */
.stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* 01 hero */
.hero { height: 300vh; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy { position: absolute; left: var(--gut); top: 50%; transform: translateY(-46%); max-width: 640px; z-index: 2; }
.hero-copy .kicker { margin-bottom: 26px; }
.stages { position: relative; height: 2.05em; font-size: clamp(52px, 9.2vw, 148px); }
.stage { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; transform: translateY(.28em); transition: opacity .22s linear, transform .6s var(--ease); }
.stage.on { opacity: 1; transform: none; transition: opacity .6s var(--ease) .18s, transform .8s var(--ease) .12s; }
.stage.out { opacity: 0; transform: translateY(-.28em); transition-duration: .3s, .5s; }
.lead { color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); max-width: 30em; margin: 30px 0 34px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-foot { position: absolute; left: var(--gut); right: var(--gut); bottom: 28px; display: flex; align-items: center; gap: 18px; font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; z-index: 2; }
.hero-foot b { color: var(--text); font-weight: 400; }
.hero-foot .line { flex: 1; height: 1px; background: var(--line); }
.hero-foot .line i { display: block; height: 100%; background: var(--text); transform-origin: 0 50%; transform: scaleX(0); }

/* 02 identity */
.identity { height: 240vh; border-top: 1px solid var(--line); }
.identity .stick { display: flex; align-items: center; }
.steps { list-style: none; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 56px 1fr; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--dim); transition: color .4s var(--ease); }
.steps li.on { color: var(--text); }
.steps b { font-weight: 400; font-size: 12px; padding-top: 4px; }
.steps strong { display: block; font-weight: 400; font-size: 20px; letter-spacing: -.01em; }
.steps span { font-size: 15px; color: var(--muted); }
.steps li:not(.on) span { color: var(--dim); }
.addr-box { border-left: 1px solid var(--line); padding-left: clamp(20px, 4vw, 56px); }
.addr { font-size: clamp(22px, 3vw, 46px); line-height: 1.22; word-break: break-all; margin: 18px 0 28px; min-height: 3.7em; color: var(--text); }
.addr .k { color: var(--acc); }
.addr .s { color: var(--dim); }
.addr-meta { display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.addr-meta .track { flex: 1; height: 1px; background: var(--line); }
.addr-meta .track i { display: block; height: 100%; background: var(--acc); transform-origin: 0 50%; transform: scaleX(0); }

/* 03 chat */
.chat { padding: clamp(110px, 16vh, 180px) 0; background: var(--bg2); perspective: 1400px; }
.device { border: 1px solid var(--line2); background: var(--bg); box-shadow: 0 30px 60px -30px rgba(20, 23, 26, .25); transform-style: preserve-3d; will-change: transform; max-width: 470px; justify-self: end; width: 100%; }
.device-top, .device-input { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; font-size: 12px; }
.device-top { border-bottom: 1px solid var(--line); }
.device-input { border-top: 1px solid var(--line); color: var(--dim); }
.device-input { justify-content: flex-start; gap: 10px; }
.device-input .lock { color: var(--acc); margin-left: auto; }
.who { display: flex; align-items: center; gap: 10px; }
.dot { width: 6px; height: 6px; background: var(--acc); display: inline-block; }
.thread { padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 360px; }
.msg { max-width: 82%; padding: 12px 15px; font-size: 15px; line-height: 1.45; border: 1px solid var(--line); word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--blue); border-color: var(--blue); color: #fff; }
.msg.me.cipher { color: rgba(255, 255, 255, .78); }
.msg.them { align-self: flex-start; }
.msg.sys { align-self: center; border: 0; font-size: 11px; color: var(--muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .1em; }
.msg.cipher { font-family: var(--mono); font-size: 13px; color: #8899a6; }

/* 04 calls */
.call { padding: clamp(110px, 16vh, 180px) 0 clamp(70px, 10vh, 120px); border-top: 1px solid var(--line); }
.call-stage { position: relative; height: clamp(260px, 42vh, 420px); margin: 30px 0 10px; cursor: crosshair; }
#wave { position: absolute; inset: 0; width: 100%; height: 100%; }
.peer { position: absolute; top: 50%; display: grid; gap: 2px; font-size: 12px; transform: translateY(18px); }
.peer i { position: absolute; top: -26px; width: 9px; height: 9px; background: var(--text); }
.peer b { font-weight: 400; color: var(--text); }
.peer span { color: var(--dim); }
.peer.left { left: var(--gut); }
.peer.left i { left: 0; }
.peer.right { right: var(--gut); text-align: right; }
.peer.right i { right: 0; }
.call-state { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; white-space: nowrap; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.ctl { height: 40px; padding: 0 18px; border: 1px solid var(--line2); font-family: var(--mono); font-size: 12px; transition: border-color .25s, background .25s, color .25s; }
.ctl:hover { border-color: var(--text); }
.ctl.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.ctl.end:hover { background: #e0245e; border-color: #e0245e; color: #fff; }

/* 05 + 06 index rows */
.index, .token, .road { padding: clamp(110px, 16vh, 180px) 0; border-top: 1px solid var(--line); }
.rows { list-style: none; border-top: 1px solid var(--line); margin-top: 20px; }
.row {
  position: relative; display: grid; grid-template-columns: 70px minmax(180px, 1fr) 1.4fr 30px; gap: 20px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid var(--line); overflow: hidden;
}
.row::before { content: ""; position: absolute; inset: 0; background: rgba(29, 161, 242, .07); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .45s var(--ease); z-index: -1; }
.row:hover::before { transform: scaleY(1); }
.row .n { font-size: 12px; color: var(--dim); transition: color .3s; }
.row strong { font-weight: 300; font-size: clamp(22px, 2.2vw, 32px); letter-spacing: -.02em; transition: transform .45s var(--ease); }
.row p { color: var(--muted); font-size: 15px; opacity: .55; transition: opacity .35s; }
.row i { font-style: normal; color: var(--dim); justify-self: end; transform: translateX(-10px); opacity: 0; transition: transform .45s var(--ease), opacity .3s, color .3s; }
.row:hover .n, .row:hover i { color: var(--acc); }
.row:hover strong { transform: translateX(10px); }
.row:hover p { opacity: 1; }
.row:hover i { transform: none; opacity: 1; }
.rows.compact .row { grid-template-columns: 44px minmax(140px, .9fr) 1.4fr; padding: 22px 0; }
.rows.compact .row strong { font-size: clamp(20px, 1.8vw, 26px); }
.tick { color: var(--acc); }
.ca { margin-top: 36px; border: 1px solid var(--line2); padding: 18px 20px; }
.ca-row { margin-top: 12px; }

/* contract address row (hero + token section) */
[data-ca] { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ca-k { font-size: 12px; letter-spacing: .14em; color: var(--muted); flex: none; }
.ca-v { flex: 1; min-width: 0; font-size: clamp(12px, 1.05vw, 15px); color: var(--text); word-break: break-all; line-height: 1.45; }
[data-ca]:not(.has-ca) .ca-v { color: var(--dim); }
.has-ca .ca-v { cursor: copy; }
.ca-copy { flex: none; height: 34px; padding: 0 14px; border: 1px solid var(--line2); font-size: 12px; letter-spacing: .04em; color: var(--text); transition: background .2s, color .2s, border-color .2s; }
.ca-copy:hover:not(:disabled) { background: var(--text); color: var(--bg); border-color: var(--text); }
.ca-copy:disabled { opacity: .45; cursor: default; }
.ca-copy.done { background: var(--text); color: var(--bg); border-color: var(--text); }
.hero-ca { margin-top: 26px; padding: 12px 12px 12px 16px; border: 1px solid var(--line2); max-width: 600px; background: rgba(255, 255, 255, .06); }

/* 07 roadmap */
.phases { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 40px; padding-top: 34px; }
.rail { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.rail i { display: block; height: 100%; background: var(--acc); transform-origin: 0 50%; transform: scaleX(0); }
.phase { position: relative; color: var(--dim); transition: color .5s var(--ease); }
.phase::before { content: ""; position: absolute; top: -38px; left: 0; width: 7px; height: 7px; background: var(--bg); border: 1px solid var(--line2); transition: background .4s, border-color .4s; }
.phase.on { color: var(--text); }
.phase.on::before { background: var(--acc); border-color: var(--acc); }
.phase span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.phase strong { display: block; font-weight: 300; font-size: clamp(22px, 2vw, 30px); letter-spacing: -.02em; margin: 12px 0 10px; }
.phase p { font-size: 15px; color: var(--muted); }
.phase:not(.on) p { color: var(--dim); }

/* footer */
.foot { border-top: 1px solid var(--line); padding: clamp(60px, 10vh, 120px) 0 32px; overflow: hidden; }
.big { position: relative; font-size: clamp(40px, 11.2vw, 180px); font-weight: 300; letter-spacing: -.06em; line-height: .9; padding: 0 var(--gut); white-space: nowrap; }
.big .outline { color: transparent; -webkit-text-stroke: 1px var(--line2); }
.big .fill { position: absolute; left: var(--gut); top: 0; color: var(--text); clip-path: inset(0 100% 0 0); }
.foot-row { display: flex; justify-content: space-between; gap: 20px; margin-top: 46px; font-size: 12px; color: var(--muted); }
.foot-links { display: flex; gap: 26px; }
.foot-links a:hover { color: var(--text); }

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* toast */
.toast { --text: #14171a; --bg: #fff; position: fixed; left: 50%; bottom: 28px; z-index: 70; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 12px 18px; transition: opacity .3s, transform .4s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* responsive */
@media (max-width: 960px) {
  .links { display: none; }
  .two { grid-template-columns: 1fr; }
  .device { justify-self: stretch; max-width: none; }
  .addr-box { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 0; }
  .phases { grid-template-columns: 1fr 1fr; row-gap: 56px; }
  .rail { display: none; }
  .phase::before { top: -18px; }
}
@media (max-width: 640px) {
  .nav { height: 60px; }
  .nav .btn { height: 38px; padding: 0 14px; font-size: 12px; }
  .hero { height: 260vh; }
  .hero-copy { top: auto; bottom: 74px; transform: none; right: var(--gut); }
  .stages { font-size: clamp(34px, 11vw, 64px); }
  .lead { margin: 20px 0 24px; font-size: 15px; }
  .hero-ca { margin-top: 16px; padding: 10px 10px 10px 12px; gap: 10px; }
  .ca-v { font-size: 11.5px; }
  .ca-copy { height: 32px; padding: 0 11px; }
  .identity { height: 220vh; }
  .identity h2 { margin-bottom: 18px; }
  .steps li { padding: 12px 0; }
  .steps strong { font-size: 17px; }
  .steps span { font-size: 13px; }
  .addr { font-size: 20px; margin: 12px 0 18px; min-height: 4.9em; }
  .addr-box { padding-top: 20px; }
  .row, .rows.compact .row { grid-template-columns: 40px 1fr; row-gap: 8px; padding: 20px 0; }
  .row p { grid-column: 2; opacity: 1; }
  .row i { display: none; }
  .phases { grid-template-columns: 1fr; }
  .peer { font-size: 11px; }
  .foot-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .stage { transition: none; }
}

/* word-by-word heading reveal */
h2[data-reveal] { opacity: 1; transform: none; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.w > span { display: inline-block; transform: translateY(112%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 55ms); }
.in .w > span { transform: none; }

/* marquee strip */
.strip { overflow: hidden; border-bottom: 1px solid var(--line); padding: 18px 0; background: var(--bg); }
.strip-track { display: flex; width: max-content; will-change: transform; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.strip-track span { padding: 0 26px; white-space: nowrap; }
.strip-track b { color: var(--blue); font-weight: 500; }

/* click ripple: a call ring */
.ring { position: fixed; z-index: 80; width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 1.5px solid var(--blue); border-radius: 50%; pointer-events: none; animation: ring .9s var(--ease) forwards; }
.ring.w2 { animation-delay: .12s; opacity: 0; }
.ring.on-blue { border-color: #fff; }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(11); opacity: 0; } }

/* cursor follower */
.cur { position: fixed; left: 0; top: 0; z-index: 90; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 1.5px solid var(--ink); border-radius: 50%; pointer-events: none; opacity: 0; transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), opacity .3s, background .3s, border-color .3s; }
.cur.show { opacity: .55; }
.cur.big { width: 58px; height: 58px; margin: -29px 0 0 -29px; background: rgba(29, 161, 242, .16); border-color: var(--blue); }
.cur.on-blue { border-color: #fff; }
.cur.on-blue.big { background: rgba(255, 255, 255, .22); border-color: #fff; }

/* typing dots in the chat input */
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
.dot { animation: blink 1.6s infinite; border-radius: 50%; }
@keyframes blink { 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  .w > span { transform: none; transition: none; }
  .ring, .cur { display: none; }
  .typing i, .dot { animation: none; }
}

.mark .far { opacity: .55; }
