@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/cormorant-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/cormorant-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/jbmono-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/jbmono-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122; }

:root {
  --bg: #070706;
  --ink: #b8b2a5;
  --ink-dim: #6d685e;
  --ink-faint: #3e3b35;
  --rust: #8a4a26;
  --rust-hot: #b0612f;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { font-family: var(--mono); font-size: 11px; letter-spacing: .26em; text-transform: lowercase; }
[hidden] { display: none !important; }
button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }

.grain, .vignette { position: fixed; inset: -10%; z-index: 30; pointer-events: none; }
.grain { opacity: .11; mix-blend-mode: overlay; animation: grain 1.1s steps(7) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.3 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes grain { 0%{transform:translate(0,0)} 15%{transform:translate(-3%,2%)} 30%{transform:translate(2%,-3%)} 45%{transform:translate(-2%,-1%)} 60%{transform:translate(3%,3%)} 75%{transform:translate(-1%,2%)} 100%{transform:translate(0,0)} }
.vignette { inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 38%, rgba(0,0,0,.72) 100%); }

/* ---------- главная ---------- */
#home { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 24px max(9vh, env(safe-area-inset-bottom)); text-align: center; pointer-events: none; }
#home > * { pointer-events: auto; }
.row { display: flex; align-items: center; justify-content: center; gap: 1.6em; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; align-items: center; gap: 2.2em; }
.stack-sm { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1em; }
.sep { color: var(--ink-faint); }
.title { margin: 0; color: var(--ink-dim); letter-spacing: .42em; font-size: 10px; }
.note { margin: 0; min-height: 1.4em; color: var(--ink-dim); font-size: 10px; letter-spacing: .2em; line-height: 1.9; text-transform: none; max-width: 36em; }
.dim { color: var(--ink-faint); margin-left: .8em; }

.link { position: relative; color: var(--ink-dim); padding: .9em .2em; transition: color .6s ease, opacity .6s, text-shadow .8s; }
.link::after { content: ""; position: absolute; left: .2em; right: .2em; bottom: .55em; height: 1px; background: currentColor; opacity: 0; transform: scaleX(.2); transform-origin: left; transition: opacity .6s, transform 1s cubic-bezier(.2,.7,.2,1); }
.link:hover, .link:focus-visible { color: var(--rust-hot); outline: none; text-shadow: 0 0 18px rgba(176, 97, 47, .35); }
.link:hover::after, .link:focus-visible::after { opacity: .7; transform: scaleX(1); }
.link.strong { color: var(--ink); }
.link.tiny { font-size: 10px; padding: .6em .3em; }
.link[disabled] { opacity: .35; pointer-events: none; }

#gate, #actions { opacity: 0; transition: opacity 2.4s ease; }
body.ov #home, body.ov #snd { opacity: 0 !important; pointer-events: none !important; transition: opacity .8s ease; }
#gate.on, #actions.on { opacity: 1; }
#actions .title { opacity: .9; }

.corner { position: fixed; z-index: 40; top: max(18px, env(safe-area-inset-top)); right: 22px; font-size: 10px; letter-spacing: .26em; color: var(--ink-faint);
  padding: .8em .4em; transition: color .6s; }
.corner:hover { color: var(--rust-hot); }
.corner.muted { text-decoration: line-through; }
#snd { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); right: 18px; }

/* ---------- оверлеи ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(5, 5, 4, .86); opacity: 0; transition: opacity 1.4s ease; display: flex; align-items: center; justify-content: center; }
.overlay[hidden] { display: none; }
.overlay.on { opacity: 1; }
.overlay .close { left: 22px; right: auto; }

.panel { width: min(30em, 86vw); display: flex; flex-direction: column; gap: 2.4em; text-align: left; }
.panel .title { text-align: left; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.2em; }
.steps li { display: grid; grid-template-columns: 2.6em 1fr auto; gap: .8em; color: var(--ink-faint); transition: color 1s; align-items: baseline; }
.steps li i { font-style: normal; }
.steps li b { font-weight: 400; }
.steps li em { font-style: normal; font-size: 10px; color: var(--ink-faint); text-transform: none; letter-spacing: .15em; }
.steps li.now { color: var(--ink); }
.steps li.now em { color: var(--rust-hot); animation: pulse 2.2s ease-in-out infinite; }
.steps li.done { color: var(--ink-dim); }
.steps li.done b { text-decoration: line-through; text-decoration-color: var(--ink-faint); }
@keyframes pulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }

.wallet-btn { text-align: left; }
.wallet-btn img { width: 14px; height: 14px; vertical-align: -2px; margin-right: 1em; filter: grayscale(1) brightness(.8); opacity: .8; }

/* ---------- читалка ---------- */
#reader { background: rgba(4, 4, 3, .93); flex-direction: column; }
.r-top { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 0; right: 0; padding: 0 22px; display: flex; justify-content: space-between; align-items: center; z-index: 5; color: var(--ink-faint); font-size: 10px; }
.r-actions { display: flex; gap: 1.2em; }
#r-ref { padding: .6em 0; letter-spacing: .4em; }
.r-hit { position: absolute; top: 12%; bottom: 12%; z-index: 2; background: none; }
.r-prev { left: 0; width: 34%; cursor: w-resize; }
.r-next { right: 0; width: 66%; cursor: e-resize; }
.r-stage { position: relative; z-index: 3; width: min(34em, 86vw); min-height: 40vh; display: flex; align-items: center; justify-content: center; pointer-events: none; }

.verse { font-family: var(--serif); font-weight: 500; text-transform: none; letter-spacing: .015em; font-size: clamp(22px, 3.3vw + 6px, 36px); line-height: 1.55; text-align: center; color: #bcb6a8; text-wrap: balance; max-width: 100%; }
.verse.small { font-size: clamp(18px, 2.4vw + 6px, 26px); }
.verse .w { display: inline-block; white-space: nowrap; }
.verse .l { display: inline-block; opacity: 0; filter: blur(7px); transform: translateY(.18em); transition: opacity 1.3s ease, filter 1.5s ease, transform 1.8s cubic-bezier(.2,.7,.2,1), color 2s; transition-delay: var(--id, 0ms); }
.verse.in .l { opacity: 1; filter: blur(0); transform: none; transition-delay: var(--id, 0ms); }
.verse.out .l { opacity: 0; filter: blur(5px); transition: opacity .7s ease, filter .7s ease, transform .9s ease-in; transition-delay: var(--od, 0ms); transform: translate(var(--ox, 0), var(--oy, 22px)) rotate(var(--or, 0deg)); }
.verse.in .l.dim { opacity: .42; transition: opacity .5s; transition-delay: 0ms; }
.verse .l.rust { color: var(--rust-hot); }
.verse .mono { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .5em; color: var(--ink-faint); margin-bottom: 2.4em; text-transform: lowercase; }
.verse .big { display: block; font-size: 1.28em; letter-spacing: .06em; }
.verse .sub { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .4em; color: var(--ink-dim); margin-top: 2.2em; }
.verse .gap { display: block; height: 1.6em; }

.r-bottom { position: absolute; bottom: max(26px, env(safe-area-inset-bottom)); left: 0; right: 0; padding: 0 22px; display: flex; justify-content: space-between; color: var(--ink-faint); font-size: 10px; z-index: 5; pointer-events: none; }
.r-line { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(255,255,255,.03); z-index: 5; }
.r-line i { display: block; height: 100%; width: 0; background: var(--rust); opacity: .6; transition: width 1.2s ease; }
.r-msg { position: absolute; bottom: 14%; left: 0; right: 0; text-align: center; margin: 0 auto; z-index: 6; }

#r-toc { position: absolute; inset: 0; z-index: 8; background: rgba(4,4,3,.97); display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 14vh 24px; }
#r-toc[hidden] { display: none; }
#r-toc ol { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: .4em; width: min(30em, 100%); }
#r-toc button { display: grid; grid-template-columns: 2.6em 1fr; width: 100%; text-align: left; padding: .8em 0; color: var(--ink-dim); text-transform: lowercase; letter-spacing: .12em; font-size: 11px; transition: color .5s; }
#r-toc button:hover, #r-toc button.cur { color: var(--rust-hot); }
#r-toc button i { font-style: normal; color: var(--ink-faint); }

@media (max-width: 640px) {
  body { font-size: 10px; letter-spacing: .22em; }
  .r-prev { width: 30%; } .r-next { width: 70%; }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } .verse .l { transition-duration: .01s !important; } }

/* выбор токена, подсказки, ключ-ссылка, QR */
.wallet-btn.sel { color: var(--ink); }
.wallet-btn.sel::after { opacity: .5; transform: scaleX(1); }
#b-help a { color: var(--ink-faint); text-transform: none; letter-spacing: .12em; }
#b-help a:hover { color: var(--rust-hot); }
#r-key { position: absolute; inset: 0; z-index: 9; background: rgba(4,4,3,.97); display: flex; align-items: center; justify-content: center; padding: 10vh 24px; }
#r-key[hidden] { display: none; }
.r-key-in { width: min(34em, 100%); display: flex; flex-direction: column; gap: 1.6em; }
#r-key-url { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--ink-faint); color: var(--ink-dim); font: inherit; font-size: 11px; letter-spacing: .08em; text-transform: none; padding: .8em 0; outline: none; text-overflow: ellipsis; }
#r-key-url:focus { color: var(--ink); border-color: var(--rust); }
.qr { display: flex; flex-direction: column; gap: 1.2em; align-items: flex-start; }
.qr svg { width: min(220px, 60vw); height: auto; display: block; background: #b8b2a5; padding: 10px; opacity: .88; }
.qr .note { max-width: 24em; }

/* ---------- поддержать ---------- */
.support { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); padding: .9em 1.2em;
  font-size: 10px; letter-spacing: .34em; color: #57544c; opacity: 0; transition: color .6s, opacity 2.4s ease; }
.support.on { opacity: 1; }
.support:hover, .support:focus-visible { color: var(--rust-hot); outline: none; }
body.ov .support { opacity: 0 !important; pointer-events: none !important; transition: opacity .8s ease; }
.addrs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2em; }
.addrs li { display: flex; flex-direction: column; gap: .7em; }
.addrs .net { color: var(--ink-dim); letter-spacing: .3em; font-size: 10px; }
.addrs .net small { color: var(--ink-faint); letter-spacing: .15em; font-size: 10px; margin-left: 1em; text-transform: none; }
.addrs .addr { font-size: 11px; letter-spacing: .06em; text-transform: none; color: var(--ink); word-break: break-all; line-height: 1.7; user-select: all; -webkit-user-select: all; }
.addrs .acts { display: flex; gap: 1.4em; align-items: center; }
.addrs .qr { margin-top: .4em; }
.addrs .qr svg { width: min(180px, 52vw); }
#donate .panel { max-height: 86vh; overflow-y: auto; padding: 8vh 0; gap: 1.8em; scrollbar-width: none; }
#donate .panel::-webkit-scrollbar { display: none; }
#donate .panel > * { flex-shrink: 0; }
@media (min-width: 641px) {
  .overlay .close { color: var(--ink); }
  .overlay .close:hover { color: var(--rust-hot); }
  .r-top, .r-bottom { color: var(--ink-dim); }
  #r-ref, #r-chap, #r-count { color: var(--ink-dim); }
  #r-ref { letter-spacing: .34em; }
}
