/* Ghost. One scene carries the look: a friendly bedsheet ghost on a stool in a dark room at night, typing on a laptop.
   The screen is the only light: it glows on the sheet, on the desk and on the wall, and the AI on the other side sees a
   sheet with two eye holes, never a face. The screen is the button and says what to do next; every key dresses the
   ghost in its own sheet. Everything you press is a little piece of sheet with a wavy hem; every value you read sits on
   a small lit screen. The room is night indigo, the lit pages are the white of a bright screen. */

@font-face { font-family: 'Sour Gummy'; src: url('/fonts/sour-gummy.woff2') format('woff2'); font-weight: 100 900; font-stretch: 100% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sour Gummy'; src: url('/fonts/sour-gummy-italic.woff2') format('woff2'); font-weight: 100 900; font-stretch: 100% 125%; font-style: italic; font-display: swap; }
@font-face { font-family: 'SUSE'; src: url('/fonts/suse.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: 'Commit Mono'; src: url('/fonts/commit-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Commit Mono'; src: url('/fonts/commit-mono-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* the room */
  --night: #111228;
  --room: #1a1c3a;
  --room-hi: #24274f;
  --room-lo: #141530;
  /* the light of the screen */
  --glow: #e3ebff;
  --glow-2: #b4c6ff;
  --glow-3: #8aa0f4;
  --sheet: #f5f6fb;
  --sheet-lo: #dfe3f2;
  --hole: #07081a;
  --warm: #ff9a4d;
  --screen-ink: #1c2052;

  /* the surface you are on: the dark room by default, a lit page with .paper */
  --bg: var(--room);
  --fg: #eceffa;
  --fg-2: #c2c7e2;
  --mute: #9096bb;
  --line: rgba(196, 208, 255, .14);
  --line-2: rgba(196, 208, 255, .3);
  --em: var(--glow-2);
  --field: #0f1029;
  --field-line: rgba(196, 208, 255, .38);
  --key-face: #2e3264;
  --key-on: #eef1fb;
  --go-face: var(--sheet);
  --go-on: #15162e;
  --good: #64d6a0;
  --bad: #ff8686;

  --display: 'Sour Gummy', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --text: 'SUSE', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Commit Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* the weave of a cotton sheet, very faint */
  --weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .32 0 0 0 0 .5 0 0 0 .45 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23f)' opacity='.2'/%3E%3C/svg%3E");

  --fs-0: .8125rem;
  --fs-1: .9375rem;
  --fs-2: 1.0625rem;
  --fs-3: 1.375rem;
  --fs-4: clamp(2.1rem, 1.4rem + 2.4vw, 3.3rem);
  --fs-5: clamp(2.5rem, 1.4rem + 2.7vw, 3.75rem);

  --page: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}
.paper {
  --bg: #eef1f9;
  --fg: #15162e;
  --fg-2: #3c3f60;
  --mute: #666a8b;
  --line: #d5daea;
  --line-2: #b4bad3;
  --em: #4251d4;
  --field: #fff;
  --field-line: #15162e;
  --key-face: #ffffff;
  --key-on: #15162e;
  --go-face: #23265a;
  --go-on: #f4f6fd;
  --good: #1f7a4a;
  --bad: #c22a2a;
  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(--room); }
body {
  margin: 0; background: var(--room); 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: .18em; }
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%; }
[hidden] { display: none !important; }
::selection { background: var(--glow-2); color: var(--screen-ink); }
:focus-visible { outline: 3px solid var(--glow-2); outline-offset: 3px; border-radius: 4px; }
.paper :focus-visible { outline-color: var(--em); }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .9em; }
.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 bedsheet ghost and the name */
.mark { display: inline-flex; align-items: center; gap: 9px; line-height: 1; }
.mark b { font: 800 29px/1 var(--display); letter-spacing: -.01em; color: var(--fg); translate: 0 -1px; }
.gh { width: 30px; height: 33px; flex: none; overflow: visible; }
.gh-cloth { fill: var(--sheet); }
.gh-shade { fill: #c3c9e6; }
.gh-eye { fill: var(--hole); }
.paper .gh-cloth, .sheet .gh-cloth { fill: #fff; stroke: #15162e; stroke-width: 2.2; }
.paper .gh-shade, .sheet .gh-shade { fill: #dfe3f2; }

/* ---------- buttons: a small piece of sheet, rounded on top, a wavy hem below. The plain ones are night indigo, the
   one you should press is the white of the sheet (on a lit page: the night sheet). Pressing lowers it onto the desk. */
.key {
  --face: var(--key-face); --on: var(--key-on);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 1.35em 2px; margin-bottom: 6px; border: 0; border-radius: 22px 22px 5px 5px;
  background: linear-gradient(100deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 46%, rgba(0, 0, 20, .12)), var(--face); color: var(--on);
  font: 700 var(--fs-2)/1 var(--text); letter-spacing: .005em; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  filter: drop-shadow(0 3px 0 rgba(4, 5, 22, .5)) drop-shadow(0 9px 12px rgba(4, 5, 22, .28));
  transform: translateY(0); transition: transform .08s ease-out, filter .08s ease-out;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.key::after { /* the hem */
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 7px; background: var(--face);
  -webkit-mask: radial-gradient(circle at 50% 0, #000 6.4px, transparent 7px) 50% 0 / 14px 7px repeat-x;
  mask: radial-gradient(circle at 50% 0, #000 6.4px, transparent 7px) 50% 0 / 14px 7px repeat-x;
}
.key:hover { transform: translateY(-1px); }
.key:active, .key[aria-pressed='true'] { transform: translateY(2px); filter: drop-shadow(0 1px 0 rgba(4, 5, 22, .5)) drop-shadow(0 3px 4px rgba(4, 5, 22, .22)); }
.key:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.key.go { --face: var(--go-face); --on: var(--go-on); }
.paper .key, .sheet .key { box-shadow: inset 0 0 0 2px #15162e; }
.paper .key::after, .sheet .key::after { background: #15162e; }
.paper .key:not(.go)::before, .sheet .key:not(.go)::before { /* the hem of a white sheet on a lit page: white inside a dark edge */
  content: ''; position: absolute; left: 2px; right: 2px; bottom: -4px; height: 6px; z-index: 1; background: var(--face);
  -webkit-mask: radial-gradient(circle at 50% 0, #000 4.4px, transparent 5px) 50% 0 / 14px 6px repeat-x;
  mask: radial-gradient(circle at 50% 0, #000 4.4px, transparent 5px) 50% 0 / 14px 6px repeat-x;
}
.paper .key.go, .sheet .key.go { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.paper .key.go::after, .sheet .key.go::after { background: var(--face); }
.paper .key, .sheet .key { filter: drop-shadow(0 3px 0 rgba(21, 22, 46, .28)) drop-shadow(0 8px 10px rgba(21, 22, 46, .14)); }
.key.big { min-height: 62px; padding: 0 1.7em 2px; font-size: 1.1875rem; border-radius: 30px 30px 6px 6px; }
.key.small { min-height: 40px; padding: 0 1em 1px; font-size: var(--fs-1); border-radius: 18px 18px 4px 4px; }
.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: .2em; }
.plain:hover { text-decoration-thickness: .14em; text-decoration-color: var(--em); }

/* ---------- a lit screen: every value you read (the credit at the top, the balance, the 404) shows on one */
.lit {
  position: relative; color: var(--screen-ink); border-radius: 9px;
  background: linear-gradient(115deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 38%), linear-gradient(170deg, #f4f7ff, #d6e0ff);
  box-shadow: 0 0 0 3px #0c0d1e, 0 0 0 4px rgba(190, 205, 255, .16), 0 10px 26px -8px rgba(150, 175, 255, .5);
}
.lettered { font-family: var(--display); font-weight: 800; letter-spacing: .005em; font-variant-numeric: lining-nums tabular-nums; }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--room) 90%, 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: 76px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--fg); padding: 4px 2px; }
.brand .gh { transition: translate .25s ease-out; }
.brand:hover .gh { translate: 0 -3px; }
.nav { display: flex; gap: clamp(14px, 2.4vw, 30px); margin-left: auto; font-weight: 600; font-size: var(--fs-2); }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--line-2); }
.nav a[aria-current='page'] { border-bottom-color: var(--glow-2); }
.top-x { display: inline-flex; padding: 8px; margin: -8px; }
.top-x svg { width: 19px; height: 19px; }
/* the credit at the top: a small lit screen, 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: 92px; padding: 9px 13px 8px; font-size: 1.35rem; line-height: 1; text-align: center; }
.menu-btn { display: none; }

/* ---------- the hero: the room at night. One unit, --u, sizes the scene; the screen is an HTML button laid on the
   drawing at the same measures. */
.hero {
  --u: 16px;
  position: relative; overflow: clip; padding: clamp(28px, 5vw, 60px) 0 0;
  background:
    radial-gradient(70% 80% at 78% 62%, rgba(150, 172, 255, .14), rgba(150, 172, 255, 0) 70%),
    repeating-linear-gradient(90deg, rgba(196, 208, 255, .028) 0 2px, rgba(196, 208, 255, 0) 2px 44px),
    linear-gradient(180deg, #17183a, #1c1e3f 55%, #191a37);
}
.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, 80px); }
.hero h1 { font: 800 var(--fs-5)/1.02 var(--display); letter-spacing: -.012em; color: #f2f4fd; text-wrap: balance; }
.hero h1 em { font-style: italic; font-weight: 800; color: var(--glow-2); }
.hero h1 .ln { display: block; margin-top: .06em; }
.hero .lead { margin-top: 26px; max-width: 30em; font-size: clamp(1.125rem, 1rem + .5vw, 1.3125rem); line-height: 1.5; color: var(--fg-2); text-wrap: pretty; }
.hero .lead b { font-weight: 700; color: #f2f4fd; }
.hero .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; margin-top: 36px; }
.hero .acts .plain { color: #f2f4fd; }

/* ---------- 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 sheet the ghost wears: one of six, picked by the key (home.js) */
.scene .cloth { fill: url(#gh-p0); }
.scene.p1 .cloth { fill: url(#gh-p1); }
.scene.p2 .cloth { fill: url(#gh-p2); }
.scene.p3 .cloth { fill: url(#gh-p3); }
.scene.p4 .cloth { fill: url(#gh-p4); }
.scene.p5 .cloth { fill: url(#gh-p5); }
/* a ghost hovers a hair above its stool, always */
.scene .ghost { animation: hover 4.2s ease-in-out infinite; }
@keyframes hover { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.6px; } }
.scene .steam path { animation: steam 3.4s ease-in-out infinite; }
.scene .steam path + path { animation-delay: -1.7s; }
@keyframes steam { 0%, 100% { opacity: .35; translate: 0 1px; } 50% { opacity: 1; translate: 0 -2px; } }

/* the screen: a bright chat window on the laptop, turned toward the ghost. Skewed like the lid it sits in. */
.screen {
  position: absolute; z-index: 2; left: 4.7em; top: 9.8em; width: 13.4em; height: 11.6em; padding: .7em .9em .85em; border: 0; border-radius: .1em;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; text-align: center; color: var(--screen-ink);
  transform: skewY(-8deg); transform-origin: 0 0; -webkit-tap-highlight-color: transparent;
  background: linear-gradient(118deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 34%), linear-gradient(170deg, #f7f9ff, #e3e9fc);
  box-shadow: 0 0 2.6em .5em rgba(160, 182, 255, .32), 0 0 .7em rgba(220, 230, 255, .55);
  transition: box-shadow .15s, filter .15s;
}
.screen:hover { filter: brightness(1.03); box-shadow: 0 0 3.2em .8em rgba(160, 182, 255, .42), 0 0 .8em rgba(220, 230, 255, .7); }
.screen:active { filter: brightness(.98); }
.screen:focus-visible { outline: 3px solid var(--glow-2); outline-offset: .5em; }
.screen .scr-bar { display: flex; align-items: center; gap: .45em; font: 700 .62em/1 var(--mono); color: #59608f; text-align: left; white-space: nowrap; overflow: hidden; }
.screen .scr-dot { width: .9em; height: .9em; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 35%, #fff, #b7c4f2 70%); box-shadow: 0 0 0 .1em #c5cef0; }
.screen .say { align-self: center; justify-self: center; font: 800 2.05em/1.02 var(--display); letter-spacing: .01em; max-width: 100%; text-wrap: balance; }
.screen .say.num { font-size: 2.5em; font-variant-numeric: lining-nums tabular-nums; }
.screen .say.num.long { font-size: 2.05em; }
.screen .scr-in { display: flex; align-items: center; justify-content: space-between; gap: .6em; padding: .5em .7em; border-radius: 1em; background: #fff; box-shadow: inset 0 0 0 .07em #c8d0ee, 0 .1em .4em rgba(60, 70, 140, .12); }
.screen small { font: 400 .64em/1.2 var(--mono); color: #5a618c; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.screen .caret { flex: none; width: .5em; height: .95em; border-radius: .1em; background: var(--warm); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
/* new words are typed out; the ghost looks up and taps a key */
.scene.on .screen .say { animation: type .75s steps(9, end) both; }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.scene.on .arm { animation: tap .32s ease-in-out 3; transform-origin: 256px 190px; transform-box: view-box; }
@keyframes tap { 50% { rotate: 2.4deg; translate: 0 1.2px; } }
.scene.on .eyes { animation: peek .9s ease-in-out; transform-origin: 291px 115px; transform-box: view-box; }
@keyframes peek { 0%, 100% { translate: 0 0; } 18% { scale: 1 .14; } 30% { scale: 1 1; } 60% { translate: -1.6px -.6px; } }

/* ---------- home */
.band { padding: clamp(52px, 8vw, 104px) 0; border-top: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.hero + .band, .band.paper, .band.paper + .band, .band.dark + .band { border-top: 0; }
.band h2 { font: 800 var(--fs-4)/1.04 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.band h2 em { font-style: italic; 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; }

/* 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); color: var(--mute); padding: 0 0 10px; border-bottom: 2px solid var(--fg); white-space: nowrap; }
.prices td { padding: 13px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.prices .n { text-align: right; font-family: var(--mono); font-size: .875rem; 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.1rem/1.25 var(--text); letter-spacing: -.01em; }
.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: the editor on the night screen */
.code { background: #0c0d20; color: #e7eafb; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px rgba(196, 208, 255, .16), 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: 9px 13px; border-radius: 8px 8px 0 0; font: 600 var(--fs-1)/1 var(--text); color: #9aa0c4; }
.code-tabs button:hover { color: #fff; }
.code-tabs button[aria-selected='true'] { background: #191b38; color: #fff; }
.code-tabs .copy { margin-left: auto; margin-bottom: 6px; }
.code pre { margin: 0; padding: 20px 22px 22px; background: #191b38; overflow-x: auto; font: 400 .8375rem/1.7 var(--mono); tab-size: 2; }
.code pre .c { color: #8287ad; } .code pre .s { color: #ffc08f; } .code pre .k { color: var(--glow-2); font-weight: 700; }
.copy { background: #2b2e57; color: #e7eafb; border: 0; border-radius: 6px; padding: 7px 11px; font: 600 var(--fs-0)/1 var(--text); }
.copy:hover { background: #393d6e; }
.copy.done { background: var(--glow-2); color: var(--screen-ink); }

/* the dark band: the far corner of the room */
.band.dark { background: linear-gradient(180deg, var(--night), #15162f); }
/* the plain dark bands are the wall of the room: the same faint wallpaper stripes as behind the ghost */
.band:not(.paper):not(.dark) { background: repeating-linear-gradient(90deg, rgba(196, 208, 255, .024) 0 2px, rgba(196, 208, 255, 0) 2px 44px), var(--room); }
.band.dark .intro { color: var(--fg-2); }

/* 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: 800 1.65rem/1.15 var(--display); padding-bottom: 12px; border-bottom: 2px solid var(--fg); }
.ledger li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.mem { counter-reset: mem; }
.mem li { display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline; counter-increment: mem; }
.mem li::before { content: counter(mem, decimal-leading-zero); font: 400 .9375rem/1 var(--mono); color: var(--mute); }
/* never kept: each line behind two eye holes, which is all anyone gets */
.ledger .no li { display: flex; align-items: center; gap: 14px; color: var(--fg-2); }
.ledger .no li::before { content: ''; flex: none; width: 20px; height: 13px;
  background: radial-gradient(closest-side, var(--fg) 88%, transparent) 1px 1px / 7px 11px no-repeat, radial-gradient(closest-side, var(--fg) 88%, transparent) 10px 0 / 8px 12.5px no-repeat; }
.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: 18px 0; font: 700 1.1875rem/1.3 var(--text); letter-spacing: -.01em; cursor: pointer; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: '+'; font: 400 1.6rem/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(--room); }
.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 bright screen over the room */
dialog.sheet {
  --bg: #f6f8fd; --fg: #15162e; --fg-2: #3c3f60; --mute: #666a8b; --line: #d8ddec; --line-2: #b4bad3; --em: #4251d4;
  --field: #fff; --field-line: #15162e; --key-face: #ffffff; --key-on: #15162e; --go-face: #23265a; --go-on: #f4f6fd; --good: #1f7a4a; --bad: #c22a2a;
  width: min(100% - 24px, 500px); max-height: min(100dvh - 24px, 860px); padding: 0; border: 0; border-radius: 14px;
  background: linear-gradient(118deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 30%), var(--bg); color: var(--fg); overflow: auto;
  box-shadow: 0 0 0 5px #0c0d1e, 0 0 0 6px rgba(190, 205, 255, .2), 0 0 70px 8px rgba(150, 175, 255, .3), 0 30px 70px rgba(4, 5, 22, .6);
}
dialog.sheet::backdrop { background: rgba(10, 11, 30, .72); 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: 800 2rem/1.05 var(--display); }
.x { background: none; border: 0; width: 40px; height: 40px; margin: -8px -10px 0 0; border-radius: 8px; font: 400 1.7rem/1 var(--mono); color: var(--mute); }
.x:hover { background: rgba(21, 22, 46, .07); color: var(--fg); }
.sheet p { font-size: var(--fs-1); line-height: 1.5; }
.keyline { margin: 4px 0 16px; padding: 15px 16px 14px; border: 2px solid var(--fg); border-radius: 8px; background: #fff; font: 400 .9375rem/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: 700 1rem/1 var(--mono); color: var(--fg); margin: 0 7px 0 8px; }
.balance { margin: 12px 6px 22px; padding: 20px 20px 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.balance b { font-size: 3.2rem; line-height: .95; }
.balance span { font: 700 var(--fs-0)/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: #4f5788; 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(--warm); }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr) 1.25fr; gap: 12px; margin: 8px 3px 20px; }
.amounts .key { padding: 0; min-height: 46px; }
.amounts .key[aria-pressed='true'] { --face: var(--go-face); --on: var(--go-on); }
.amounts .key[aria-pressed='true']::before { display: none; }
.amounts .key[aria-pressed='true']::after { background: var(--go-face); }
.amounts label { position: relative; display: block; }
.amounts label span { position: absolute; left: 12px; top: 50%; translate: 0 -50%; font-weight: 700; pointer-events: none; }
.amounts input { width: 100%; height: 46px; padding: 0 8px 0 26px; border: 2px solid var(--fg); border-radius: 8px; 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: 8px; 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: 400 .78rem/1.45 var(--mono); overflow-wrap: anywhere; }
.field .val b.amt { font: 700 1.2rem/1.15 var(--mono); letter-spacing: -.01em; }
.mini { background: #23265a; color: #fff; border: 0; border-radius: 6px; padding: 7px 10px; font: 600 var(--fs-0)/1 var(--text); flex: none; box-shadow: 0 2px 0 #0c0d1e; }
.mini:hover { background: #31357a; }
.mini:active { transform: translateY(1px); box-shadow: 0 1px 0 #0c0d1e; }
.mini.done { background: var(--good); }
.status { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: 8px; background: #e3e8f6; font-weight: 600; font-size: var(--fs-1); }
.status.seen { background: #ffe6cf; }
.status.ok { background: var(--good); color: #fff; }
/* waiting: a little ghost floats up and down */
.wait { position: relative; width: 16px; height: 18px; flex: none; animation: float 1.4s ease-in-out infinite;
  background: radial-gradient(ellipse 2px 3px at 5px 7px, #f6f8fd 95%, transparent), radial-gradient(ellipse 2.2px 3.2px at 10.6px 6.8px, #f6f8fd 95%, transparent), currentColor;
  border-radius: 8px 8px 2px 2px; color: #23265a; }
@keyframes float { 0%, 100% { translate: 0 1px; } 50% { translate: 0 -3px; } }
.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; 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: 48px; padding: 0 14px; border: 2px solid var(--fg); border-radius: 8px; background: #fff; font: 400 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 16px 20px; }
.credited .lit small { display: block; font: 700 var(--fs-0)/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; color: #4f5788; }
.credited .lit b { display: block; font-size: 3.6rem; 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(--sheet); color: var(--screen-ink); padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: var(--fs-1); box-shadow: 0 0 0 3px #0c0d1e, 0 12px 30px rgba(0, 0, 0, .4); animation: rise .2s ease-out; max-width: calc(100% - 32px); }

/* ---------- text pages: lit by the screen */
.page { padding: clamp(30px, 6vw, 70px) 0 clamp(60px, 8vw, 110px); }
.page h1 { font: 800 clamp(2.5rem, 1.5rem + 3.6vw, 4.4rem)/1.02 var(--display); letter-spacing: -.012em; text-wrap: balance; }
.page h1 em { font-style: italic; color: var(--em); }
.page .lead { margin-top: 20px; max-width: 36em; font-size: 1.25rem; line-height: 1.45; color: var(--fg-2); }
.prose { max-width: 44em; }
.prose h2 { font: 800 1.85rem/1.1 var(--display); margin: 52px 0 14px; }
.prose h3 { font: 700 1.1875rem/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: 400 .88em var(--mono); background: color-mix(in srgb, var(--fg) 8%, transparent); padding: .12em .38em; border-radius: 4px; }
.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.5, 16px); }
  .hero .wrap { grid-template-columns: 1fr; gap: 0; }
  .hero .words { padding-bottom: 10px; }
  .hero .scene { margin: 26px auto 0; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav { position: fixed; inset: 76px 0 auto 0; z-index: 29; flex-direction: column; gap: 0; padding: 6px var(--gutter) 18px; background: var(--room); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px rgba(4, 5, 22, .4); font-size: 1.25rem; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current='page'] { border-bottom-color: var(--line); color: var(--glow-2); }
  .menu-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: auto; margin-right: -8px; background: none; border: 0; border-radius: 8px; color: var(--fg); }
  .menu-btn svg { width: 24px; height: 24px; }
  .top .wrap { gap: 12px; }
  .top-x { display: none; }
  .mark b { font-size: 26px; }
  .gh { width: 27px; 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%; }
}
@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(--night); color: #dfe3f6; font-size: 13px; 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: 38px; padding-block: 6px; }
.ca-t { font: italic 800 17px/1 var(--display); color: var(--glow-2); }
.ca-v { font-family: var(--mono); color: var(--glow); overflow-wrap: anywhere; min-width: 0; }
.ca-copy, .ca-go { font: inherit; font-weight: 700; color: var(--screen-ink); background: var(--sheet); border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; text-decoration: none; }
.ca-go { background: var(--glow-2); color: var(--screen-ink); }
