/* unsent museum — design tokens and components.
   one type scale, one spacing scale, one radius scale, one motion curve. dark only. */
:root {
  --bg: #0b0b0d;
  --surface: #131316;
  --surface-2: #1a1a1e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fg: #ECEAE4;
  --muted: #9A978F;
  --dim: #6B6963;
  --gold: #F5D061;
  --rose: #E01E5A;
  --green: #2EB67D;
  --focus: rgba(236, 234, 228, 0.9);

  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: Lora, Georgia, "Times New Roman", serif;

  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 17px; --fs-lg: 20px; --fs-xl: 24px; --fs-2xl: 30px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 120ms; --t-base: 200ms;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --content: 600px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body { font-family: var(--sans); font-size: var(--fs-base); line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
p a, .prose a, .kv a, .proof a, .row-links a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color var(--t-fast); }
p a:hover, .prose a:hover, .kv a:hover, .proof a:hover, .row-links a:hover { text-decoration-color: var(--fg); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(236, 178, 46, 0.35); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

h1 { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 var(--s-2); }
h2 { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; margin: var(--s-8) 0 var(--s-2); }
p { margin: 0 0 var(--s-3); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: var(--fs-sm); }
.body { font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.body.lg { font-size: var(--fs-xl); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-sm); }
pre { background: var(--surface); border: 1px solid var(--line); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); overflow-x: auto; }
.ok { color: var(--green); } .bad { color: var(--rose); }

/* ---------- layout ---------- */
.wrap { max-width: var(--content); margin: 0 auto; padding: 0 var(--s-4); }
@media (min-width: 640px) { .wrap { padding: 0 var(--s-6); } }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); height: 56px; padding: 0 var(--s-4); background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); }
.top .brand { font-weight: 600; letter-spacing: -0.01em; }
.top nav { display: flex; gap: var(--s-4); align-items: center; }
.top nav a { color: var(--muted); font-size: var(--fs-sm); transition: color var(--t-fast); }
.top nav a:hover, .top nav a.on { color: var(--fg); }
main.wrap { padding-top: var(--s-5); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); max-width: var(--content); margin: 0 auto; padding: var(--s-10) var(--s-4) calc(var(--s-6) + var(--safe-b)); color: var(--dim); font-size: var(--fs-sm); }
.foot a { color: var(--muted); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: 44px; padding: 0 var(--s-5); background: var(--fg); color: var(--bg) !important; border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-base); text-decoration: none !important; white-space: nowrap; transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast), opacity var(--t-fast); }
.btn:hover { background: #fff; }
.btn:active { transform: scale(0.98); }
.btn.small { height: 34px; padding: 0 var(--s-4); font-size: var(--fs-sm); }
.btn.ghost { background: transparent; color: var(--fg) !important; border: 1px solid var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--fg); }
.btn.big { width: 100%; height: 54px; font-size: var(--fs-md); }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.actions { display: flex; gap: var(--s-3); margin: var(--s-4) 0; }
.actions > * { flex: 1; }

.search { display: flex; gap: var(--s-2); margin: var(--s-3) 0 var(--s-2); }
.search input { flex: 1; min-width: 0; height: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 var(--s-4); outline: none; transition: border-color var(--t-fast); }
.search input:focus { border-color: var(--line-strong); }
.search input::placeholder { color: var(--dim); }
.search .btn { height: 44px; }

/* colors: .cN backgrounds are generated per palette entry in the page head */
.ink-light { color: #F6F2EC; } .ink-dark { color: #121114; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }

/* ---------- wall ---------- */
body.wall { overflow-x: hidden; overscroll-behavior-y: none; }
.wall-top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; gap: var(--s-2); align-items: center; height: 60px; padding: 0 var(--s-3); background: linear-gradient(var(--bg) 55%, rgba(11, 11, 13, 0)); }
.wall-top .brand { font-weight: 600; white-space: nowrap; padding: 6px var(--s-1); flex-shrink: 0; }
.wall-top form { flex: 1; display: flex; min-width: 0; max-width: 420px; margin: 0 auto; }
.wall-top input { flex: 1; min-width: 0; height: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 var(--s-4); font-size: var(--fs-sm); outline: none; transition: border-color var(--t-fast); }
.wall-top input:focus { border-color: var(--line-strong); }
.wall-top input::placeholder { color: var(--dim); }
.wall-top .btn { flex-shrink: 0; }
#wall { position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; display: block; touch-action: pan-y; }
#spacer { width: 1px; }
.empty-wall { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--s-6); color: var(--muted); z-index: 2; pointer-events: none; }
.empty-wall p { margin: 0 0 var(--s-1); }
.empty-wall .big { font-size: var(--fs-lg); color: var(--fg); font-weight: 600; letter-spacing: -0.01em; }
.empty-wall .btn { pointer-events: auto; margin-top: var(--s-4); }

.hud { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-3) calc(var(--s-3) + var(--safe-b)); background: linear-gradient(rgba(11, 11, 13, 0), var(--bg) 45%); font-size: var(--fs-sm); color: var(--muted); }
.hud .zoom { display: flex; flex-shrink: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; }
.hud .zoom button { width: 40px; height: 36px; font-size: 18px; line-height: 1; color: var(--muted); transition: background var(--t-fast), color var(--t-fast); }
.hud .zoom button:hover { background: var(--surface-2); color: var(--fg); }
.hud .zoom button + button { border-left: 1px solid var(--line); }
.hud .status { min-width: 0; flex: 1; line-height: 1.3; font-variant-numeric: tabular-nums; }
.hud .status > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .live { color: var(--dim); font-size: var(--fs-xs); }
.hud .live.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { color: var(--fg); } 100% { color: var(--dim); } }
.hud .btn { flex-shrink: 0; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity var(--t-base); }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--s-3) var(--s-5) calc(var(--s-5) + var(--safe-b)); transform: translateY(105%); transition: transform 260ms var(--ease); max-height: 82dvh; overflow-y: auto; box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55); }
.sheet.open { transform: translateY(0); }
.sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto var(--s-4); }
.sheet .body { padding: var(--s-4) var(--s-5); border-radius: var(--r-lg); min-height: 96px; }
.sheet .meta { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); color: var(--muted); font-size: var(--fs-sm); margin: var(--s-4) 0 var(--s-2); font-variant-numeric: tabular-nums; }
.sheet .actions { margin-top: var(--s-4); }
.sheet .nav { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s-4); }
.sheet .nav button { width: 44px; height: 44px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); font-size: 24px; line-height: 1; color: var(--muted); transition: background var(--t-fast), color var(--t-fast); }
.sheet .nav button:hover { background: var(--surface-2); color: var(--fg); }
.sheet.bump { animation: bump 250ms var(--ease); }
@keyframes bump { 50% { transform: translateY(6px); } }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; width: min(560px, 100vw - 32px); transform: translate(-50%, 105%); border-radius: var(--r-xl); border-bottom: 1px solid var(--line); bottom: var(--s-6); padding-bottom: var(--s-5); }
  .sheet.open { transform: translate(-50%, 0); }
  .sheet .grip { display: none; }
  .sheet .nav span { display: none; }
}

/* ---------- write ---------- */
.compose { padding-bottom: var(--s-8); }
.compose .lead { margin: 0 0 var(--s-5); color: var(--muted); }
.card { --ink: #121114; --ink-soft: rgba(18, 17, 20, 0.6); border-radius: var(--r-xl); padding: var(--s-5) var(--s-5) var(--s-3); background: var(--surface); color: var(--ink); transition: background 350ms var(--ease), color 350ms var(--ease); }
.card textarea { width: 100%; min-height: 148px; background: transparent; border: 0; outline: none; resize: none; font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.4; color: inherit; display: block; }
.card textarea::placeholder { color: var(--ink-soft); }
.card .row { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--ink-soft); border-top: 1px solid var(--ink-soft); padding-top: var(--s-2); }
.card .to { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.card .to input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: var(--fs-base); color: var(--ink); padding: var(--s-1) 0; }
.card .to input::placeholder { color: var(--ink-soft); }
.card .to input:focus-visible { outline: none; }
.card .count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .count.over { color: var(--rose); }
.colors { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-4) 2px var(--s-2); align-items: center; }
.colors label { display: block; }
.colors label.extra { display: none; }
.colors.expanded label.extra { display: block; }
.colors input { position: absolute; opacity: 0; pointer-events: none; }
.colors .chip { display: block; width: 40px; height: 40px; border-radius: var(--r-pill); border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--bg); transition: transform var(--t-fast) var(--ease), border-color var(--t-fast); cursor: pointer; }
.colors .chip:hover { transform: scale(1.06); }
.colors input:checked + .chip { border-color: var(--fg); transform: scale(1.12); }
.colors input:focus-visible + .chip { outline: 2px solid var(--focus); outline-offset: 2px; }
.colors .more { width: 40px; height: 40px; border-radius: var(--r-pill); border: 1px dashed var(--dim); color: var(--muted); font-size: 20px; line-height: 1; display: grid; place-items: center; transition: border-color var(--t-fast), color var(--t-fast); }
.colors .more:hover { border-color: var(--fg); color: var(--fg); }
.next { font-size: var(--fs-sm); color: var(--muted); margin: var(--s-2) 2px 0; }
.next b { color: var(--fg); font-weight: 600; }
.or[hidden], #express[hidden] { display: none; }
#express { margin-top: var(--s-5); }
.or { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-4) 0 0; color: var(--dim); font-size: var(--fs-sm); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#link-auth { margin-top: var(--s-5); }
#payment { margin: var(--s-3) 0; min-height: 40px; }
.cf-turnstile { margin: var(--s-3) 0; min-height: 0; }
.error { color: var(--dim); font-size: var(--fs-sm); margin: var(--s-2) 0; min-height: 20px; }
.error.hard { color: var(--rose); }
.pay-note { text-align: center; font-size: var(--fs-sm); color: var(--dim); margin-top: var(--s-3); }

/* ---------- seal ---------- */
body.seal { overflow: hidden; }
.seal-stage { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s-6) var(--s-5) calc(var(--s-6) + var(--safe-b)); gap: var(--s-5); }
.seal-block { width: min(86vw, 400px); aspect-ratio: 1; border-radius: var(--r-xl); background: var(--surface); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: var(--s-6); transition: background 900ms var(--ease), box-shadow 900ms var(--ease); }
.seal-block.lit { box-shadow: 0 0 90px -10px var(--glow); }
.seal-block.milestone { outline: 6px solid var(--gold); outline-offset: 6px; }
.seal-block .body { font-size: clamp(18px, 4.6vw, 24px); opacity: 0; transition: opacity 600ms 500ms; }
.seal-block.lit .body { opacity: 1; }
.seal-block .bottom { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-base); opacity: 0; transition: opacity 600ms 800ms; }
.seal-block.lit .bottom { opacity: 1; }
.seal-block .num { font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--fs-md); }
.seal-title { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.015em; opacity: 0; transform: translateY(6px); transition: opacity 500ms 1400ms, transform 500ms 1400ms; text-align: center; }
.seal-title.show { opacity: 1; transform: none; }
.seal-title small { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; margin-top: var(--s-1); font-variant-numeric: tabular-nums; }
.seal-actions { width: min(86vw, 400px); display: flex; flex-direction: column; gap: var(--s-3); opacity: 0; transition: opacity 500ms 1900ms; }
.seal-actions.show { opacity: 1; }
.seal-actions .row { display: flex; gap: var(--s-3); }
.seal-actions .row a { flex: 1; }
.seal-wait { color: var(--muted); text-align: center; font-size: var(--fs-sm); }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ---------- block page ---------- */
.block-card { border-radius: var(--r-xl); padding: var(--s-6); margin: var(--s-2) 0 var(--s-4); min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-6); }
.block-card.milestone { outline: 4px solid var(--gold); outline-offset: 4px; }
.block-card .bottom { display: flex; justify-content: space-between; font-size: var(--fs-sm); opacity: 0.9; font-variant-numeric: tabular-nums; }
.proof { font-size: var(--fs-sm); color: var(--muted); margin: var(--s-1) 0 var(--s-3); line-height: 1.55; }
.row-links { font-size: var(--fs-sm); color: var(--muted); margin: var(--s-1) 0 var(--s-4); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s-4); font-size: var(--fs-sm); color: var(--muted); margin: var(--s-3) 0; }
.kv b { font-weight: 500; color: var(--fg); overflow-wrap: anywhere; }

/* ---------- lists (to/:name) ---------- */
.list .item { display: block; padding: var(--s-4) var(--s-5); border-radius: var(--r-lg); margin: var(--s-3) 0; text-decoration: none !important; transition: transform var(--t-fast) var(--ease); }
.list .item:hover { transform: translateY(-1px); }
.list .item .body { font-size: var(--fs-md); }
.list .item .meta { font-size: var(--fs-sm); opacity: 0.8; margin-top: var(--s-2); display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; margin: var(--s-5) 0; font-size: var(--fs-sm); }

/* ---------- verify ---------- */
.verify .rec { display: block; border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin: var(--s-3) 0; }
.verify .rec .meta { font-size: var(--fs-sm); opacity: 0.85; margin-top: var(--s-2); display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* ---------- review ---------- */
.review table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.review td { padding: var(--s-3) var(--s-2); border-top: 1px solid var(--line); vertical-align: top; }
.review .body { font-size: var(--fs-base); }
.review form { display: inline; }
.review button { border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 6px var(--s-3); font-size: var(--fs-sm); transition: background var(--t-fast); }
.review button:hover { background: var(--surface-2); }

/* ---------- prose ---------- */
.prose { padding-bottom: var(--s-6); }
.prose p, .prose li { color: #CFCCC4; }
.notice { border: 1px solid var(--gold); color: var(--gold); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); margin: var(--s-4) 0; }
