/* Veil. One scene carries the look: a milliner's counter against a lilac wall. A pillbox hat sits on a turned maple
   hat stand, and a black net veil hangs from its brim where a face would be. The AI on the other side only ever meets
   the veil. The chenille dots of the veil spell what to do next, and the veil is the button. Every key gives the hat
   its own colour; the pearl pins in the cushion count the credit. Everything you press is a cut piece of grosgrain
   ribbon (chartreuse for the thing to do, black for the rest); every value you read sits on a black ribbon label. */

@font-face { font-family: 'Chonburi'; src: url('/fonts/chonburi.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Josefin Sans'; src: url('/fonts/josefin-sans.woff2') format('woff2'); font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Josefin Sans'; src: url('/fonts/josefin-sans-italic.woff2') format('woff2'); font-weight: 100 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inconsolata'; src: url('/fonts/inconsolata.woff2') format('woff2'); font-weight: 200 900; font-display: swap; }

:root {
  /* the shop */
  --wall: #dccfe8;
  --wall-hi: #e9e1f1;
  --wall-lo: #cbbbdc;
  --tissue: #f7f2f8;
  --ink: #1c1320;
  --net: #120c15;
  --plum: #5e2a72;
  --aub: #3d2645;
  --lime: #cde14a;
  --lime-lo: #a9bd27;
  --pearl: #f6f0e6;
  --maple: #d9ae78;
  --velvet: #18111b;

  /* the surface you are on: the lilac wall by default, tissue paper with .paper, black velvet with .dark */
  --bg: var(--wall);
  --fg: var(--ink);
  --fg-2: #43354b;
  --mute: #6f5f78;
  --line: rgba(28, 19, 32, .14);
  --line-2: rgba(28, 19, 32, .32);
  --em: var(--plum);
  --field: #fff;
  --field-line: var(--ink);
  --key-face: var(--ink);
  --key-on: var(--pearl);
  --key-rib: rgba(255, 255, 255, .07);
  --go-face: var(--lime);
  --go-on: var(--ink);
  --go-rib: rgba(60, 70, 0, .1);
  --good: #2c7a3f;
  --bad: #b3243a;

  --display: 'Chonburi', 'Didot', 'Bodoni 72', Georgia, serif;
  --text: 'Josefin Sans', 'Futura', 'Century Gothic', system-ui, sans-serif;
  --mono: 'Inconsolata', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-0: .875rem;
  --fs-1: 1rem;
  --fs-2: 1.125rem;
  --fs-3: 1.4rem;
  --fs-4: clamp(2rem, 1.35rem + 2vw, 2.8rem);
  --fs-5: clamp(2.55rem, 1.4rem + 3vw, 4rem);

  --page: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}
.paper {
  --bg: var(--tissue);
  background: var(--bg); color: var(--fg);
}
.dark {
  --bg: var(--velvet);
  --fg: #f3ecf3;
  --fg-2: #cdc1d2;
  --mute: #a092a8;
  --line: rgba(243, 236, 243, .14);
  --line-2: rgba(243, 236, 243, .32);
  --em: var(--lime);
  --key-face: var(--pearl);
  --key-on: var(--ink);
  --key-rib: rgba(60, 40, 20, .07);
  background: var(--bg); color: var(--fg);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; background: var(--wall); }
body {
  margin: 0; background: var(--wall); color: var(--fg);
  font: 400 var(--fs-2)/1.55 var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .14em; text-decoration-color: var(--em); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
b, strong { font-weight: 700; }
[hidden] { display: none !important; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 3px; }
.dark :focus-visible { outline-color: var(--lime); }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .95em; }
.mute { color: var(--mute); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- the mark: a little pillbox with its veil, and the name */
.mark { display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.mark b { font: 400 30px/1 var(--display); letter-spacing: -.01em; color: var(--fg); translate: 0 1px; }
.vl { width: 32px; height: 34px; flex: none; overflow: visible; }
.vl-hat { fill: var(--ink); }
.vl-band { fill: var(--lime); }
.vl-net { fill: var(--ink); opacity: .2; }
.vl-mesh { stroke: var(--ink); stroke-width: .6; opacity: .45; fill: none; }
.vl-dot { fill: var(--ink); }
.dark .vl-hat, .dark .vl-dot { fill: var(--pearl); }
.dark .vl-net { fill: var(--pearl); }
.dark .vl-mesh { stroke: var(--pearl); }

/* ---------- buttons: a cut length of grosgrain ribbon, swallowtail at both ends. The one you should press is
   chartreuse, the rest are black (ivory on black velvet). Pressing it flattens it onto the counter. */
.key {
  --face: var(--key-face); --on: var(--key-on); --rib: var(--key-rib); --n: 11px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 50px; padding: 3px calc(var(--n) + 1.05em) 0; border: 0; border-radius: 0;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--n)) 50%, 100% 100%, 0 100%, var(--n) 50%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, .16)),
    repeating-linear-gradient(90deg, var(--rib) 0 1px, transparent 1px 3px),
    var(--face);
  color: var(--on);
  font: 700 var(--fs-2)/1 var(--text); letter-spacing: .03em; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .3);
  transform: translateY(0); transition: transform .08s ease-out, filter .1s ease-out, box-shadow .08s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.key:hover { transform: translateY(-1px); filter: brightness(1.06); }
.key:active, .key[aria-pressed='true'] { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .2), inset 0 2px 3px rgba(0, 0, 0, .18); }
.key:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--plum), inset 0 0 0 5px var(--face); }
.dark .key:focus-visible { box-shadow: inset 0 0 0 3px var(--lime), inset 0 0 0 5px var(--face); }
.key:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.key.go { --face: var(--go-face); --on: var(--go-on); --rib: var(--go-rib); }
.key.big { --n: 14px; min-height: 62px; padding-inline: calc(var(--n) + 1.25em); font-size: 1.25rem; }
.key.small { --n: 8px; min-height: 40px; padding-inline: calc(var(--n) + .8em); font-size: var(--fs-1); }
.key svg { width: 1.1em; height: 1.1em; flex: none; }
.plain { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .22em; }
.plain:hover { text-decoration-thickness: .14em; text-decoration-color: var(--em); }

/* ---------- a ribbon label: every value you read (the credit at the top, the balance, the 404) is printed on one */
.lit {
  --n: 9px;
  position: relative; color: var(--pearl);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--n)) 50%, 100% 100%, 0 100%, var(--n) 50%);
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .25)), repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 3px), var(--ink);
}
.dark .lit { color: var(--ink); background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .12)), repeating-linear-gradient(90deg, rgba(60, 40, 20, .06) 0 1px, transparent 1px 3px), var(--pearl); }
.lettered { font-family: var(--display); font-weight: 400; letter-spacing: 0; font-variant-numeric: lining-nums tabular-nums; }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--wall) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: clamp(14px, 3vw, 36px); min-height: 78px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--fg); padding: 4px 2px; }
.brand .vl { transition: rotate .3s ease-out; transform-origin: 50% 20%; }
.brand:hover .vl { rotate: -6deg; }
.nav { display: flex; gap: clamp(16px, 2.6vw, 34px); margin-left: auto; font-weight: 600; font-size: var(--fs-2); }
.nav a { text-decoration: none; padding: 8px 0 5px; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--line-2); }
.nav a[aria-current='page'] { border-bottom-color: var(--plum); }
.top-x { display: inline-flex; padding: 8px; margin: -8px; }
.top-x svg { width: 19px; height: 19px; }
/* the credit at the top: a black ribbon label, pressable */
.credit { display: inline-flex; align-items: center; padding: 0; border: 0; background: none; margin: 4px; transition: transform .07s; }
.credit:hover { transform: translateY(-1px); }
.credit:active { transform: translateY(1px); }
.credit .lit { display: block; min-width: 104px; padding: 11px 20px 8px; font-size: 1.3rem; line-height: 1; text-align: center; }
.menu-btn { display: none; }

/* ---------- the hero: the lilac wall of the shop, light from the upper left. One unit, --u, sizes the scene; the
   veil is an HTML button laid on the drawing at the same measures. */
.hero {
  --u: 16px;
  position: relative; overflow: clip; padding: clamp(28px, 5vw, 56px) 0 0;
  background:
    radial-gradient(60% 70% at 18% 12%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .16) 0 1px, rgba(255, 255, 255, 0) 1px 9px, rgba(90, 60, 120, .045) 9px 10px, rgba(255, 255, 255, 0) 10px 26px),
    linear-gradient(180deg, var(--wall-hi), var(--wall) 60%, var(--wall-lo));
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: clamp(20px, 4vw, 56px); }
.hero .words { align-self: center; padding: clamp(8px, 2vw, 24px) 0 clamp(40px, 6vw, 84px); }
.hero h1 { font: 400 var(--fs-5)/1.02 var(--display); letter-spacing: -.015em; color: var(--ink); text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--plum); }
.hero h1 .ln { display: block; margin-top: .04em; }
.hero .lead { margin-top: 26px; max-width: 30em; font-size: clamp(1.15rem, 1.02rem + .5vw, 1.35rem); line-height: 1.5; color: var(--fg-2); text-wrap: pretty; }
.hero .lead b { color: var(--ink); }
.hero .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; margin-top: 36px; }

/* ---------- the scene: drawn in SVG at 400 x 320 units for 40em x 32em, one unit a tenth of an em */
.scene { position: relative; flex: none; width: 40em; height: 32em; font-size: var(--u); }
.desk-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.desk-art.over { z-index: 3; }

/* the hat: one of six colours, picked by the key (home.js) */
.scene { --hat: #2b2331; --hat-hi: #4f4357; --hat-lo: #120d14; --feather: #4b4251; }
.scene.p1 { --hat: #7d2238; --hat-hi: #b04a62; --hat-lo: #44101f; --feather: #1d1520; }
.scene.p2 { --hat: #1f6a4f; --hat-hi: #45987a; --hat-lo: #0d3b2b; --feather: #1d1520; }
.scene.p3 { --hat: #273b7a; --hat-hi: #5068ad; --hat-lo: #121d46; --feather: #1d1520; }
.scene.p4 { --hat: #d69a2c; --hat-hi: #f2c56c; --hat-lo: #8e5f10; --feather: #1d1520; }
.scene.p5 { --hat: #dfa1b0; --hat-hi: #f6d2db; --hat-lo: #ad6a7c; --feather: #1d1520; }
.scene .hs-hi { stop-color: var(--hat-hi); }
.scene .hs-mid { stop-color: var(--hat); }
.scene .hs-lo { stop-color: var(--hat-lo); }
.scene .feather { fill: var(--feather); }
.scene .tag-t { font: italic 600 8.6px/1 var(--text); fill: var(--aub); }
.scene .tag-t.num { font: 400 9.4px/1 var(--display); }
/* a pearl pin for every five dollars of credit, up to five */
.scene .pin { opacity: 0; transition: opacity .3s; }
.scene .pin.on { opacity: 1; }

/* the veil: the button. Black French net, a few loose chenille dots, the words in larger ones. */
.veil-btn {
  position: absolute; z-index: 2; left: 17em; top: 9em; width: 18.4em; height: 15.2em; padding: 0; border: 0; background: none;
  -webkit-tap-highlight-color: transparent;
}
.veil-btn svg { width: 100%; height: 100%; overflow: visible; }
.veil-btn:focus-visible { outline: 3px solid var(--plum); outline-offset: .2em; border-radius: .6em; }
.veil, .sway { transform-box: view-box; transform-origin: 262px 96px; }
.sway { animation: sway 7s ease-in-out infinite; }
.veil-tint { fill: #120c15; opacity: .3; transition: opacity .15s; }
.veil-net { opacity: .75; }
.veil-edge { fill: none; stroke: #120c15; stroke-width: .9; opacity: .5; }
.spots circle { fill: #0c080e; }
.say circle { fill: url(#ve-bead); }
.veil-btn:hover .veil-tint { opacity: .36; }
.veil-btn:hover .sway { animation: flutter 1.4s ease-in-out; }
.veil-btn:active .veil-tint { opacity: .42; }
@keyframes sway { 0%, 100% { rotate: 0deg; } 50% { rotate: .5deg; } }
@keyframes flutter { 0%, 100% { rotate: 0deg; } 30% { rotate: 1.4deg; } 65% { rotate: -.8deg; } }
/* new words: the veil swings once and the dots settle into place, left to right */
.scene.on .veil { animation: swing 1.1s cubic-bezier(.3, .7, .4, 1); }
@keyframes swing { 0% { rotate: -2.2deg; } 40% { rotate: 1.4deg; } 75% { rotate: -.5deg; } 100% { rotate: 0deg; } }
.scene.on .say .d { transform-box: fill-box; transform-origin: center; animation: settle .42s cubic-bezier(.2, .8, .3, 1.3) both; }
.scene.on .say .c1 { animation-delay: .04s; } .scene.on .say .c2 { animation-delay: .08s; } .scene.on .say .c3 { animation-delay: .12s; }
.scene.on .say .c4 { animation-delay: .16s; } .scene.on .say .c5 { animation-delay: .2s; } .scene.on .say .c6 { animation-delay: .24s; }
.scene.on .say .c7 { animation-delay: .28s; } .scene.on .say .c8 { animation-delay: .32s; } .scene.on .say .c9 { animation-delay: .36s; }
@keyframes settle { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }

/* ---------- home */
.band { padding: clamp(56px, 8vw, 108px) 0; border-top: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.hero + .band, .band.paper, .band.paper + .band, .band.dark + .band, .band.dark { border-top: 0; }
.band h2 { font: 400 var(--fs-4)/1.06 var(--display); letter-spacing: -.012em; text-wrap: balance; }
.band h2 em { font-style: normal; color: var(--em); }
.band .intro { margin-top: 18px; max-width: 34em; color: var(--fg-2); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 84px); align-items: start; }
/* the plain lilac bands: the same silk stripe as behind the hat */
.band:not(.paper):not(.dark) { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .14) 0 1px, rgba(255, 255, 255, 0) 1px 9px, rgba(90, 60, 120, .04) 9px 10px, rgba(255, 255, 255, 0) 10px 26px), var(--wall); }
/* tissue paper: a hair of crinkle */
.band.paper { background: linear-gradient(170deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 40%), var(--tissue); }
/* black velvet with the faint diamonds of the net laid over it */
.band.dark { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 12px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 12px), var(--velvet); }
.band.dark .intro { color: var(--fg-2); }

/* price list */
.prices { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.prices th { text-align: left; font: 700 var(--fs-0)/1.2 var(--text); letter-spacing: .02em; color: var(--mute); padding: 0 0 10px; border-bottom: 2px solid var(--fg); white-space: nowrap; }
.prices td { padding: 14px 0 12px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.prices .n { text-align: right; font-family: var(--mono); font-size: .98rem; white-space: nowrap; padding-left: 18px; font-variant-numeric: tabular-nums; }
.prices th.n { font-family: var(--text); font-size: var(--fs-0); }
.prices td:first-child { font-weight: 700; padding-right: 12px; }
.prices tr.front td:first-child { font: 700 1.15rem/1.25 var(--text); }
.prices caption { caption-side: bottom; text-align: left; padding-top: 12px; font-size: var(--fs-0); color: var(--mute); }
.prices .id { display: block; font: 400 var(--fs-0)/1.35 var(--mono); color: var(--mute); overflow-wrap: anywhere; letter-spacing: 0; }
.prices .tag { font: 700 var(--fs-0)/1 var(--text); color: var(--em); margin-left: 8px; }
.prices tbody tr:hover td { background: color-mix(in srgb, var(--fg) 4%, transparent); }
.more { display: inline-block; margin-top: 24px; font-weight: 700; }

/* code: printed on a black card, like the label inside a hatbox */
.code { background: #0f0a11; color: #efe8f0; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px rgba(243, 236, 243, .14), 0 18px 40px -18px rgba(0, 0, 0, .7); }
.code-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 8px 0 10px; }
.code-tabs button { background: none; border: 0; padding: 10px 13px 8px; border-radius: 5px 5px 0 0; font: 600 var(--fs-1)/1 var(--text); color: #a495ab; }
.code-tabs button:hover { color: #fff; }
.code-tabs button[aria-selected='true'] { background: #211825; color: #fff; }
.code-tabs .copy { margin-left: auto; margin-bottom: 6px; }
.code pre { margin: 0; padding: 20px 22px 22px; background: #211825; overflow-x: auto; font: 400 .9rem/1.65 var(--mono); tab-size: 2; }
.code pre .c { color: #8f8097; } .code pre .s { color: #dce97a; } .code pre .k { color: #d6b3ec; font-weight: 700; }
.copy { background: #3a2d40; color: #efe8f0; border: 0; border-radius: 4px; padding: 8px 11px 6px; font: 600 var(--fs-0)/1 var(--text); }
.copy:hover { background: #4b3b52; }
.copy.done { background: var(--lime); color: var(--ink); }

/* what the server keeps, and what it never keeps */
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 5vw, 64px); margin-top: clamp(26px, 4vw, 44px); }
.ledger h3 { font: 400 1.6rem/1.15 var(--display); padding-bottom: 12px; border-bottom: 2px solid var(--fg); }
.ledger li { padding: 14px 0 12px; border-bottom: 1px solid var(--line); }
.mem { counter-reset: mem; }
.mem li { display: grid; grid-template-columns: 2.3em 1fr; align-items: baseline; counter-increment: mem; }
.mem li::before { content: counter(mem, decimal-leading-zero); font: 400 1rem/1 var(--mono); color: var(--mute); }
/* never kept: each line behind a little square of net */
.ledger .no li { display: flex; align-items: center; gap: 14px; color: var(--fg-2); }
.ledger .no li::before { content: ''; flex: none; width: 16px; height: 16px; translate: 0 -2px;
  background: radial-gradient(circle, var(--fg) 1.6px, transparent 2px) 0 0 / 8px 8px, repeating-linear-gradient(45deg, var(--line-2) 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, var(--line-2) 0 1px, transparent 1px 4px); }
.fine { margin-top: 26px; max-width: 46em; color: var(--fg-2); }

/* questions */
.qa { border-top: 2px solid var(--fg); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 0 16px; font: 700 1.2rem/1.3 var(--text); cursor: pointer; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: '+'; font: 400 1.7rem/1 var(--mono); color: var(--mute); flex: none; }
.qa details[open] summary::after { content: '\2212'; color: var(--em); }
.qa p { padding: 0 0 20px; max-width: 44em; color: var(--fg-2); }

.foot { border-top: 1px solid var(--line); padding: 34px 0 44px; font-size: var(--fs-1); color: var(--mute); background: var(--wall); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: baseline; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
.foot a { color: var(--fg); font-weight: 600; }
.foot p { max-width: 40em; }

/* ---------- the account sheet: a sheet of tissue paper over the shop */
dialog.sheet {
  --bg: var(--tissue);
  width: min(100% - 24px, 500px); max-height: min(100dvh - 24px, 860px); padding: 0; border: 0; border-radius: 6px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 35%), var(--bg); color: var(--fg); overflow: auto;
  box-shadow: 0 0 0 1px rgba(28, 19, 32, .12), 0 30px 70px rgba(40, 20, 50, .45);
}
dialog.sheet::backdrop { background: rgba(28, 16, 36, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: rise .22s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes rise { from { transform: translateY(14px) scale(.985); opacity: 0; } }
.sheet-in { padding: 26px 26px 28px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sheet-head h2 { font: 400 2rem/1.05 var(--display); }
.x { background: none; border: 0; width: 40px; height: 40px; margin: -8px -10px 0 0; border-radius: 6px; font: 400 1.8rem/1 var(--mono); color: var(--mute); }
.x:hover { background: rgba(28, 19, 32, .07); color: var(--fg); }
.sheet p { font-size: var(--fs-1); line-height: 1.5; }
.keyline { margin: 4px 0 16px; padding: 15px 16px 13px; border: 2px solid var(--fg); border-radius: 4px; background: #fff; font: 500 1rem/1.5 var(--mono); word-break: break-all; user-select: all; }
.note-name { margin: -4px 0 14px; font-size: var(--fs-1); color: var(--fg-2); }
.note-name b { font: 400 1.05rem/1 var(--display); color: var(--fg); margin: 0 7px 0 8px; }
.balance { margin: 12px 0 22px; padding: 20px 30px 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.balance b { font-size: 3.1rem; line-height: .95; }
.balance span { font: 700 var(--fs-0)/1.3 var(--text); letter-spacing: .06em; text-transform: uppercase; color: #d8ccdc; text-align: right; }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.row.spread { justify-content: space-between; }
.row.center { justify-content: center; }
.full { width: 100%; }
.gap-top { margin-top: 22px; }
.warn { margin: 20px 0 22px; padding-left: 14px; border-left: 4px solid var(--lime-lo); }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr) 1.25fr; gap: 10px; margin: 8px 0 20px; }
.amounts .key { padding: 3px 0 0; min-height: 46px; }
.amounts .key[aria-pressed='true'] { --face: var(--go-face); --on: var(--go-on); --rib: var(--go-rib); }
.amounts label { position: relative; display: block; }
.amounts label span { position: absolute; left: 12px; top: 50%; translate: 0 -46%; font-weight: 700; pointer-events: none; }
.amounts input { width: 100%; height: 46px; padding: 3px 8px 0 26px; border: 2px solid var(--fg); border-radius: 4px; background: #fff; font: 700 var(--fs-2)/1 var(--text); }
.pay { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 18px; align-items: start; }
.qr { width: 148px; height: 148px; background: #fff; padding: 8px; border-radius: 4px; box-shadow: 0 0 0 2px var(--fg); }
.qr svg, .qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.field { margin-bottom: 12px; }
.field > span { display: block; font: 600 var(--fs-0)/1.2 var(--text); color: var(--mute); margin-bottom: 5px; }
.field .val { display: flex; align-items: flex-start; gap: 8px; }
.field .val b { flex: 1; min-width: 0; font: 500 .86rem/1.45 var(--mono); overflow-wrap: anywhere; }
.field .val b.amt { font: 700 1.3rem/1.15 var(--mono); }
.mini { background: var(--ink); color: var(--pearl); border: 0; border-radius: 3px; padding: 8px 10px 6px; font: 600 var(--fs-0)/1 var(--text); flex: none; box-shadow: 0 2px 0 #000; }
.mini:hover { background: #3a2d40; }
.mini:active { transform: translateY(1px); box-shadow: 0 1px 0 #000; }
.mini.done { background: var(--good); }
.status { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px 12px; border-radius: 4px; background: #ebe1f0; font-weight: 600; font-size: var(--fs-1); }
.status.seen { background: #eef4c2; }
.status.ok { background: var(--good); color: #fff; }
/* waiting: a little veil sways */
.wait { position: relative; width: 16px; height: 18px; flex: none; transform-origin: 50% 0; animation: wait 1.4s ease-in-out infinite;
  background: radial-gradient(circle, currentColor 1.3px, transparent 1.6px) 0 4px / 5px 5px, linear-gradient(currentColor, currentColor) 0 0 / 100% 3px no-repeat;
  color: var(--ink); opacity: .9; }
@keyframes wait { 0%, 100% { rotate: -8deg; } 50% { rotate: 8deg; } }
.notes { margin-top: 16px; font-size: var(--fs-0); color: var(--mute); line-height: 1.5; }
.notes a { color: var(--fg); font-weight: 600; }
.payments { margin-top: 20px; border-top: 2px solid var(--fg); }
.payments li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 8px; border-bottom: 1px solid var(--line); font-size: var(--fs-1); }
.payments li span:last-child { font-family: var(--mono); font-size: var(--fs-0); color: var(--mute); text-align: right; }
.sheet-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--fs-1); }
.sheet-foot .danger { color: var(--bad); }
.paste { display: flex; gap: 12px; margin-top: 12px; }
.paste input { flex: 1; min-width: 0; height: 50px; padding: 0 14px; border: 2px solid var(--fg); border-radius: 4px; background: #fff; font: 500 var(--fs-1)/1 var(--mono); }
.err { color: var(--bad); font-weight: 600; margin-top: 10px; font-size: var(--fs-1); }
.credited { text-align: center; padding: 6px 0 4px; }
.credited .lit { margin: 10px 30px; padding: 22px 26px 18px; }
.credited .lit small { display: block; font: 700 var(--fs-0)/1 var(--text); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; color: #d8ccdc; }
.credited .lit b { display: block; font-size: 3.5rem; line-height: .95; }
.credited p { margin: 22px 0 20px; font-size: var(--fs-2); }

.toast { position: fixed; left: 50%; bottom: 26px; translate: -50% 0; z-index: 90; background: var(--ink); color: var(--pearl); padding: 13px 18px 11px; border-radius: 4px; font-weight: 600; font-size: var(--fs-1); box-shadow: 0 12px 30px rgba(40, 20, 50, .4); animation: rise .2s ease-out; max-width: calc(100% - 32px); }

/* ---------- text pages: tissue paper */
.page { padding: clamp(30px, 6vw, 70px) 0 clamp(60px, 8vw, 110px); }
.page h1 { font: 400 clamp(2.5rem, 1.5rem + 3.6vw, 4.3rem)/1.04 var(--display); letter-spacing: -.015em; text-wrap: balance; }
.page h1 em { font-style: normal; color: var(--em); }
.page .lead { margin-top: 20px; max-width: 36em; font-size: 1.3rem; line-height: 1.45; color: var(--fg-2); }
.prose { max-width: 44em; }
.prose h2 { font: 400 1.85rem/1.12 var(--display); margin: 52px 0 14px; }
.prose h3 { font: 700 1.25rem/1.2 var(--text); margin: 30px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul { list-style: disc; padding-left: 1.2em; }
.prose ul li::marker { color: var(--em); }
.prose ol { list-style: decimal; padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose code { font: 500 .92em var(--mono); background: color-mix(in srgb, var(--fg) 8%, transparent); padding: .12em .38em; border-radius: 3px; }
.prose .code { margin: 16px 0 22px; }
.prose .code code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: var(--fs-1); }
.prose th { text-align: left; font-weight: 700; border-bottom: 2px solid var(--fg); padding: 8px 12px 8px 0; }
.prose td { border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; vertical-align: top; }

/* ---------- small screens */
@media (max-width: 1080px) {
  .hero { --u: 13.5px; }
}
@media (max-width: 900px) {
  .hero { --u: clamp(7.5px, (100vw - 2 * var(--gutter)) / 41, 16px); }
  .hero .wrap { grid-template-columns: 1fr; gap: 0; }
  .hero .words { padding-bottom: 6px; }
  .hero .scene { margin: 20px auto 0; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav { position: fixed; inset: 78px 0 auto 0; z-index: 29; flex-direction: column; gap: 0; padding: 6px var(--gutter) 18px; background: var(--wall); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px rgba(40, 20, 50, .2); font-size: 1.3rem; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 16px 0 12px; border-bottom: 1px solid var(--line); }
  .nav a[aria-current='page'] { border-bottom-color: var(--line); color: var(--plum); }
  .menu-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: auto; margin-right: -8px; background: none; border: 0; border-radius: 6px; color: var(--fg); }
  .menu-btn svg { width: 24px; height: 24px; }
  .top .wrap { gap: 12px; }
  .top-x { display: none; }
  .mark b { font-size: 27px; }
  .vl { width: 28px; height: 30px; }
  .ledger { grid-template-columns: 1fr; gap: 34px; }
  .prices .ctx { display: none; }
  .pay { grid-template-columns: 1fr; }
  .qr { margin-inline: auto; }
  .amounts { grid-template-columns: repeat(4, 1fr); }
  .amounts label { grid-column: 1 / -1; }
  .sheet-in { padding: 22px 18px 24px; }
  .hero .acts .key.big { width: 100%; }
  .credit .lit { min-width: 0; padding: 10px 16px 7px; font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* CA-Leiste (nur wenn COIN_CA gesetzt ist) */
.ca-bar { background: var(--velvet); color: #e6dce9; font-size: 14px; border-bottom: 1px solid var(--line); }
.ca-bar .wrap { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; min-height: 40px; padding-block: 6px; }
.ca-t { font: 400 17px/1 var(--display); color: var(--lime); }
.ca-v { font-family: var(--mono); color: #f3ecf3; overflow-wrap: anywhere; min-width: 0; }
.ca-copy, .ca-go { font: inherit; font-weight: 700; color: var(--ink); background: var(--pearl); border: 0; border-radius: 3px; padding: 5px 10px 3px; cursor: pointer; text-decoration: none; }
.ca-go { background: var(--lime); color: var(--ink); }
