/* The garden site: dark and calm, the garden first; few words, which appear and fade. */
/* the two typefaces, served from the site itself (site/fonts, SIL Open Font License; its latin and latin-ext ranges) */
@font-face { font-family: 'Castoro'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/castoro-400-italic-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Castoro'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/castoro-400-italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Castoro'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/castoro-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Castoro'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/castoro-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/dm-mono-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/dm-mono-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/dm-mono-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/dm-mono-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* the site's look is the artist's collection page's (tools/gallery): Castoro for the mark, DM Mono for the rest */
:root {
  --mark: 'Castoro', 'Iowan Old Style', Georgia, serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg: #000;
  --ink: #e8e2d0;
  --quiet: #8a8578;
  --faint: #4a4740;
  --panel: rgba(16, 16, 18, 0.86);
  --line: rgba(232, 226, 208, 0.12);
  --gold: #f0c878;
  --sheet-h: 56px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.quiet { color: var(--quiet); text-decoration: none; }
.quiet:hover, .quiet:focus-visible { color: var(--ink); }
.small { font-size: 12px; }
:focus-visible { outline: 1px solid rgba(232, 226, 208, 0.5); outline-offset: 3px; }

#garden { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: grab; }
#garden:active { cursor: grabbing; }
#veil { position: fixed; inset: 0; background: var(--bg); pointer-events: none; opacity: 1; transition: opacity 1.4s ease; z-index: 1; }
#veil.open { opacity: 0; }

/* ---- home: one field, a living garden behind it ---------------------------------------------------------------- */
#home { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 18px; z-index: 2;
  padding: 27vh 16px 0; padding-top: 27dvh; background: radial-gradient(ellipse 55% 26% at 50% 31%, rgba(5, 5, 6, 0.6), rgba(5, 5, 6, 0) 70%); pointer-events: none; }
#home > * { pointer-events: auto; }
#find { display: flex; align-items: center; width: min(420px, 100%); border-bottom: 1px solid rgba(232, 226, 208, 0.28); transition: border-color 0.3s; }
#find:focus-within { border-color: rgba(232, 226, 208, 0.6); }
#who { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 12px 4px; font-size: 16px; letter-spacing: 0.02em; text-align: center; }
#who::placeholder { color: var(--quiet); }
#go { padding: 10px 6px 10px 12px; color: var(--quiet); font-size: 18px; }
#go:hover { color: var(--ink); }
#choices { display: flex; gap: 34px; align-items: center; }
#choices > * { font-size: 15px; letter-spacing: 0.1em; padding: 10px 2px; color: #d9d2bf; text-decoration: none; border-bottom: 1px solid rgba(232, 226, 208, 0.18);
  transition: color 0.3s, border-color 0.3s; }
#choices > *:hover, #choices > *:focus-visible { color: var(--ink); border-color: rgba(232, 226, 208, 0.6); }
#choices.chosen #my-garden { border-color: rgba(232, 226, 208, 0.6); color: var(--ink); }
#finder { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(420px, 100%); animation: rise 0.6s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#connect-home { padding: 8px 12px; letter-spacing: 0.04em; }
#last { font-size: 12px; letter-spacing: 0.05em; padding: 6px 8px; animation: rise 0.8s ease both; }

/* ---- the garden's chrome ----------------------------------------------------------------------------------------- */
.links { display: flex; gap: 8px; align-items: center; font-size: 11px; letter-spacing: 0.05em; }
.links .sep { color: var(--faint); }
#home-links { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
#p-links { margin-top: 14px; }
#where { position: fixed; top: max(14px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); z-index: 3; display: flex; gap: 10px;
  align-items: baseline; color: var(--quiet); font-size: 12px; letter-spacing: 0.04em; transition: opacity 3s ease; max-width: 50vw; }
#where-name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#where.dim { opacity: 0.45; }
#corner { position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 3; display: flex; gap: 2px; font-size: 12px; letter-spacing: 0.04em; }
#corner > * { padding: 6px 8px; }
#corner .on { color: var(--gold); }

#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.arrived { position: absolute; transform: translate(-50%, -100%); color: var(--gold); font-size: 11px; letter-spacing: 0.12em; white-space: nowrap;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 0 14px rgba(240, 200, 120, 0.35); transition: opacity 1.2s ease; }
.arrived.gone { opacity: 0; }

/* the strip of flowers along the bottom (computer) */
#strip { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: flex-end; gap: 12px;
  padding: 26px max(16px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(5, 5, 6, 0.85), rgba(5, 5, 6, 0)); pointer-events: none; }
#strip > * { pointer-events: auto; }
#chips { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
#chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 10px; border-radius: 4px; border: 1px solid transparent;
  text-align: left; max-width: 180px; transition: border-color 0.3s, background 0.3s; }
.chip b { font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.chip span { color: var(--quiet); font-size: 11px; }
.chip:hover { background: rgba(232, 226, 208, 0.05); }
.chip.on { border-color: rgba(232, 226, 208, 0.35); }
.chip.tied b::after { content: ' ·'; color: var(--gold); }
#strip-acts { display: flex; gap: 14px; padding-bottom: 8px; font-size: 12px; white-space: nowrap; }
.keep { position: relative; }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-left: 6px; vertical-align: 2px; opacity: 0; transition: opacity 0.4s; }
.keep.unkept .dot { opacity: 1; }

/* the flower's panel: at the right side on a computer */
#panel { position: fixed; z-index: 4; right: max(16px, env(safe-area-inset-right)); top: 56px; width: 300px; max-height: calc(100dvh - 150px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px 18px 16px; backdrop-filter: blur(6px);
  transition: opacity 0.2s ease, transform 0.25s ease; scrollbar-width: thin; }
#panel.closed { opacity: 0; transform: translateX(12px); pointer-events: none; }
#grab, #rest, #mine { display: none; }
#p-title { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: 0.01em; line-height: 1.25; overflow-wrap: anywhere; }
#p-sub { margin: 3px 0 0; color: var(--quiet); font-size: 12px; letter-spacing: 0.03em; }
#p-ded { margin: 12px 0 0; font-style: italic; color: #d8d0bb; line-height: 1.45; overflow-wrap: anywhere; }
#p-ded:empty, #p-sub:empty { display: none; }
#p-state { margin: 12px 0 0; color: var(--quiet); font-size: 12px; letter-spacing: 0.03em; }
#p-state b { color: var(--ink); font-weight: 500; }
#p-traits { margin: 14px 0 0; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; font-size: 12px; align-items: baseline; }
#p-traits:empty { display: none; }
#p-traits dt { color: var(--quiet); }
#p-traits dd { margin: 0; overflow-wrap: anywhere; }
#p-traits .of { color: var(--quiet); text-align: right; white-space: nowrap; }
#p-traits .one { color: var(--gold); }
#p-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
#p-acts button, #p-form button[type=submit], #ask .row button:first-child { padding: 8px 12px; border: 1px solid rgba(232, 226, 208, 0.22); border-radius: 4px; font-size: 13px; }
#p-acts button:hover, #p-form button[type=submit]:hover { border-color: rgba(232, 226, 208, 0.5); }
#p-form { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; }
#p-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--quiet); position: relative; }
#p-form .left { position: absolute; right: 0; top: 0; font-size: 11px; }
#p-form input { background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(232, 226, 208, 0.18); border-radius: 4px; padding: 8px 9px; font-size: 14px; color: var(--ink); outline: none; }
#p-form input:focus { border-color: rgba(232, 226, 208, 0.45); }
#p-form input.bad { border-color: rgba(230, 140, 110, 0.6); }
#p-form .why { margin: 0 0 6px; min-height: 14px; font-size: 11px; color: #c89a84; }
#f-preview { margin: 6px 0 4px; padding: 10px; border-left: 1px solid rgba(240, 200, 120, 0.4); display: flex; flex-direction: column; gap: 4px; }
#fp-title { font-weight: 500; overflow-wrap: anywhere; }
#fp-ded { font-style: italic; color: #d8d0bb; overflow-wrap: anywhere; }
#fp-ded:empty { display: none; }
.row { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
#f-status:empty { display: none; }

/* a question before something is written on chain */
#ask { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(5, 5, 6, 0.55); padding: 16px; }
#ask .box { width: min(380px, 100%); background: #101012; border: 1px solid var(--line); border-radius: 8px; padding: 20px; line-height: 1.5; }
#ask-text { margin: 0 0 10px; }
#ask-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
#ask-list button { text-align: left; padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px; display: flex; gap: 10px; align-items: center; }
#ask-list img { width: 20px; height: 20px; }

/* the work as the chain serves it */
#frame { position: fixed; inset: 0; z-index: 9; background: #000; }
#work { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity 0.6s; }
#work.on { opacity: 1; }
#frame-wait { position: absolute; left: 0; right: 0; top: 48%; text-align: center; color: var(--quiet); font-size: 13px; letter-spacing: 0.04em; margin: 0; }
#frame-acts { position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); display: flex; gap: 4px; }
#frame-acts button { padding: 6px 8px; font-size: 12px; background: rgba(0, 0, 0, 0.4); border-radius: 3px; letter-spacing: 0.03em; }
#frame-acts .rec, #corner .rec { color: #ff7a6a; }
#frame-acts .rec::before, #corner .rec::before { content: '● '; }
#work.big { transform-origin: 0 0; }
.pop { position: fixed; z-index: 7; top: calc(max(10px, env(safe-area-inset-top)) + 34px); right: max(12px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 2px;
  background: #101012; border: 1px solid var(--line); border-radius: 6px; padding: 6px; font-size: 13px; animation: rise 0.25s ease both; }
.pop button { padding: 8px 12px; text-align: left; border-radius: 3px; }
.pop button:hover { background: rgba(232, 226, 208, 0.06); }
#saved { z-index: 10; flex-direction: row; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; }
#saved-what { color: var(--quiet); font-size: 12px; margin-right: 4px; }
#frame .pop { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 36px); left: max(14px, env(safe-area-inset-left)); right: auto; }

#fps { position: fixed; z-index: 7; left: 50%; transform: translateX(-50%); top: max(36px, calc(env(safe-area-inset-top) + 30px)); color: #9aa89c; font: 11px ui-monospace, monospace; pointer-events: none; }
#hint, #note { position: fixed; left: 50%; transform: translateX(-50%); z-index: 6; color: #c9c2ae; font-size: 12px; letter-spacing: 0.03em;
  background: rgba(5, 5, 6, 0.6); padding: 7px 12px; border-radius: 3px; text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  max-width: calc(100vw - 32px); line-height: 1.5; }
#hint { top: max(84px, calc(env(safe-area-inset-top) + 76px)); }
#note { bottom: 96px; }
#hint.on, #note.on { opacity: 1; }

/* ---- a phone: the panel is a sheet from the bottom; no strip (the list is in the full sheet) ---------------------- */
@media (max-width: 760px), (pointer: coarse) {
  #strip { display: none !important; }
  #where { max-width: calc(100vw - 250px); }
  #where-count { display: none; }
  #all .wide { display: none; }
  #panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 88dvh; max-height: none; border-radius: 14px 14px 0 0; border-bottom: 0;
    padding: 0 18px max(16px, env(safe-area-inset-bottom)); overflow: hidden; display: flex; flex-direction: column;
    transform: translateY(calc(100% - var(--sheet-h))); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); touch-action: none; }
  #panel.dragging { transition: none; }
  #panel.closed { opacity: 1; transform: translateY(calc(100% - var(--sheet-h))); pointer-events: auto; }
  #grab { display: flex; justify-content: center; padding: 10px 0 6px; cursor: grab; flex: none; }
  #grab i { width: 36px; height: 4px; border-radius: 2px; background: rgba(232, 226, 208, 0.25); }
  #rest { display: block; flex: none; padding: 0 0 12px; color: var(--quiet); font-size: 12px; letter-spacing: 0.04em; text-align: center; }
  #panel.peek #rest, #panel.full #rest { display: none; }
  #panel:not(.peek):not(.full) #flower { visibility: hidden; }
  #flower { flex: none; display: flex; flex-direction: column; }
  #flower > * { order: 2; }
  #p-title, #p-sub, #p-ded, #p-state { order: 0; }
  #p-acts { order: 1; margin-top: 12px; }
  #p-traits { margin-top: 18px; }
  #panel.full #flower, #panel.full #mine { overflow-y: auto; }
  #panel.full { touch-action: pan-y; }
  #panel.full .body-scroll { overflow-y: auto; }
  #mine { display: block; flex: 1; min-height: 0; overflow-y: auto; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
  #panel:not(.full) #mine { visibility: hidden; }
  #list { list-style: none; margin: 0; padding: 0; }
  #list button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 11px 2px; border-bottom: 1px solid rgba(232, 226, 208, 0.06); text-align: left; }
  #list button span { color: var(--quiet); font-size: 12px; white-space: nowrap; }
  #list button b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #list .on b { color: var(--gold); }
  #sheet-acts { display: flex; gap: 18px; justify-content: center; padding: 16px 0 8px; font-size: 12px; }
  #p-title { font-size: 18px; }
  #p-acts button { padding: 9px 14px; }
  #note { bottom: calc(var(--sheet-h) + 18px); }
  #corner { gap: 0; }
  #corner > * { padding: 6px 6px; }
  /* the way back to the collection on the second row, across from the walk, so the first row keeps the name clear */
  #corner #all { position: fixed; top: calc(max(14px, env(safe-area-inset-top)) + 24px); right: max(12px, env(safe-area-inset-right)); }
}


/* ---- one site: home and the garden in the collection page's dress (tools/gallery): DM Mono, uppercase labels, -------
   white on black, hairlines, square frames; the Castoro mark on home */
:root { --ink: #fff; --quiet: #8a8a8a; --faint: #555; --line: #1e1e1e; --dot: #333; --panel: rgba(0, 0, 0, 0.88); --gold: #e8c37a;
  font: 400 12px/1.6 var(--mono); letter-spacing: .04em; -webkit-font-smoothing: antialiased; }
.up, #corner, #where, #strip-acts, .chip, #rest, #sheet-acts, #p-sub, #p-state, #p-acts, #hint, #note, .pop, #frame-acts, #frame-wait, .arrived, #list button span { text-transform: uppercase; }
:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }
button, input, select { text-transform: inherit; letter-spacing: inherit; }

#home .mark { font: 400 clamp(52px, 9vw, 96px)/.9 var(--mark); letter-spacing: -.02em; margin: 0; color: #fff; }
#home .tag { margin: -4px 0 8px; color: var(--quiet); letter-spacing: .06em; }
#home .tag b { color: var(--faint); font-weight: 400; white-space: nowrap; }
#choices { gap: 10px; }
#choices > * { font: inherit; letter-spacing: inherit; text-transform: uppercase; color: #fff; padding: 7px 12px; border: 1px solid #fff; border-radius: 0; transition: background .2s, color .2s; }
#choices > *:hover, #choices > *:focus-visible, #choices.chosen #my-garden { background: #fff; color: #000; border-color: #fff; }
#find { border-bottom: 1px solid var(--dot); }
#find:focus-within { border-color: #fff; }
#who { font-size: 13px; letter-spacing: .06em; }
#who::placeholder { text-transform: uppercase; color: var(--quiet); }
#connect-home, #last { text-transform: uppercase; }
#walk { position: fixed; top: calc(max(14px, env(safe-area-inset-top)) + 24px); left: max(16px, env(safe-area-inset-left)); z-index: 3; display: flex; gap: 2px; font-size: 12px; text-transform: uppercase; }
#walk > * { padding: 6px 8px; color: var(--quiet); }
/* the words stay legible over a bright flower (walking, the flowers rise behind them) */
#where, #walk, #corner { text-shadow: 0 0 2px #000, 0 0 8px rgba(0, 0, 0, .9); }
#walk > *:first-child { padding-left: 0; }
#walk > *:hover { color: #fff; }
#walk .on { color: #fff; }
#arrange[disabled] { cursor: default; color: var(--faint); }
#arrange[disabled]:hover { color: var(--faint); }
#arrange .lock { width: 9px; height: 11px; margin-right: 6px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 1.1; }
#last { background: rgba(0, 0, 0, .72); color: #ddd; }
#last:hover { color: #fff; }

#where-name { color: #fff; }
#corner > * { color: var(--quiet); }
#corner > *:hover { color: #fff; }
#corner .on { color: #fff; border-bottom: 1px solid #fff; }
.chip { border-radius: 0; padding: 6px 10px; }
.chip b { font-weight: 400; font-size: 12px; }
.chip span { font-size: 11px; color: var(--quiet); }
.chip:hover { background: none; border-color: var(--dot); }
.chip.on { border-color: #fff; }
#strip { background: linear-gradient(to top, rgba(0, 0, 0, .9), rgba(0, 0, 0, 0)); }

#panel { background: var(--panel); border: 1px solid var(--line); border-radius: 0; backdrop-filter: none; }
#p-title { font: 500 20px/1.3 var(--mono); letter-spacing: .02em; }
#p-sub { color: var(--quiet); font-size: 12px; }
#p-ded { font: italic 400 18px/1.4 var(--mark); color: #e9e4d8; }
#p-state { color: var(--quiet); font-size: 12px; }
#p-state b { color: #fff; font-weight: 400; }
#p-traits { display: block; margin: 16px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }
#p-traits .kv, .kv { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; text-transform: uppercase; font-size: 12px; }
#p-traits .kv > span:first-child { color: var(--quiet); white-space: nowrap; }
#p-traits .lead { flex: 1; border-bottom: 1px dotted var(--dot); transform: translateY(-3px); min-width: 12px; }
#p-traits b { font-weight: 400; text-align: right; }
#p-traits em { font-style: normal; color: var(--faint); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
#p-traits em.one { color: var(--gold); }
#p-acts button, #p-form button[type=submit], #ask .row button:first-child { border: 1px solid #fff; border-radius: 0; padding: 7px 12px; font-size: 12px; text-transform: uppercase; }
#p-acts button:hover, #p-form button[type=submit]:hover, #ask .row button:first-child:hover { background: #fff; color: #000; }
#p-links a { text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
#p-form label { text-transform: uppercase; }
#p-form input { background: #000; border: 1px solid var(--dot); border-radius: 0; font: 13px/1.4 var(--mono); letter-spacing: .02em; }
#p-form input:focus { border-color: #fff; }
#f-preview { border-left: 1px solid var(--dot); }
#fp-ded { font: italic 400 16px/1.4 var(--mark); }
#ask .box, .pop { background: #000; border: 1px solid var(--line); border-radius: 0; }
#ask-list button { border-radius: 0; }
.pop button { border-radius: 0; }
.pop button:hover { background: #111; }
#hint, #note { background: rgba(0, 0, 0, .72); border-radius: 0; color: #ddd; }
#frame-acts button { border-radius: 0; background: rgba(0, 0, 0, .6); }
.arrived { font-size: 11px; letter-spacing: .14em; }
@media (max-width: 760px), (pointer: coarse) {
  #panel { border-radius: 0; background: rgba(0, 0, 0, .94); }
  #grab i { background: var(--dot); border-radius: 0; }
  #list button { border-bottom: 1px solid var(--line); }
  #list button b { font-weight: 400; }
}

/* ---- the collection: the artist's own collection page ("Glyphoras by gruff", tools/gallery/gallery.html), whole ---- */
/* black ground, a serif mark, everything else in a small tracked mono; a sidebar of trait filters beside a grid */
body.scroll { overflow: auto; }
body.gallery { background: #000; }
#collection { --bg: #000; --fg: #fff; --muted: #8a8a8a; --dim: #777; --faint: #555; --dot: #333; --line: #1e1e1e; --tile: #050505;
  position: relative; z-index: 2; color: var(--fg); font: 400 12px/1.6 var(--mono); letter-spacing: .04em; -webkit-font-smoothing: antialiased; }
#collection a { color: inherit; }
#collection button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
#collection button:focus-visible, #collection a:focus-visible, #collection input:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
#collection .wrap { max-width: 1680px; margin: 0 auto; padding-block: 28px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
#collection .muted { color: var(--muted); }

/* header */
#collection .top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
#collection .logo { font: 400 clamp(46px, 7vw, 76px)/.9 var(--mark); letter-spacing: -.02em; margin: 0; text-decoration: none; display: inline-block; }
#collection .tagline { color: var(--muted); margin: 8px 0 0; letter-spacing: .06em; }
#collection .nav { display: flex; gap: 10px; text-transform: uppercase; color: var(--muted); flex-wrap: wrap; }
#collection .nav a { text-decoration: none; }
#collection .nav a:hover { color: var(--fg); }
#collection .nav .on { color: var(--fg); border-bottom: 1px solid var(--fg); }
#collection .meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 34px 0 22px; text-transform: uppercase; color: var(--muted); }
#collection .meta b { color: var(--fg); font-weight: 400; }

/* the top: one work, live, and the words beside it */
#collection .hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 56px; align-items: start; margin: 0 0 84px; }
#collection .hwork { min-width: 0; scroll-margin-top: 12px; }
/* the work at the top as tall as the screen allows with its words still under it */
#collection #c-hstage { aspect-ratio: auto; height: clamp(340px, calc(100vh - 350px), 760px); max-height: none; }
#collection .hbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 16px; }
#collection .hinfo { min-width: 0; }
#collection .hname { display: block; font: 500 20px/1.3 var(--mono); letter-spacing: .02em; text-decoration: none; overflow-wrap: anywhere; }
#collection .hname:hover { text-decoration: underline; text-underline-offset: 5px; }
#collection .hsub { color: var(--muted); text-transform: uppercase; margin-top: 2px; }
#collection .hrank { color: var(--muted); text-transform: uppercase; margin-top: 2px; }
#collection .hrank b { color: var(--fg); font-weight: 400; }
#collection .harrows { display: flex; gap: 8px; flex: none; }
#collection .harrow { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--dot); font-size: 15px; transition: border-color .15s; }
#collection .harrow:hover { border-color: var(--fg); }
#collection #c-hmarket { display: inline-block; margin-top: 16px; }
#collection #c-hmarket[hidden] { display: none; }
#collection .about { min-width: 0; max-width: 560px; padding-top: 4px; }
#collection .desc { font: 400 clamp(24px, 2.3vw, 31px)/1.32 var(--mark); letter-spacing: .005em; color: #f3f0ea; margin: 0 0 34px; text-transform: none; }
#collection .lines { border-top: 1px solid var(--line); }
#collection .line { border-bottom: 1px solid var(--line); }
#collection .lhead { width: 100%; display: flex; align-items: baseline; gap: 12px; padding: 12px 0; text-transform: uppercase; color: var(--fg); }
#collection .lhead b { font: 400 22px/1 var(--mark); min-width: 34px; font-variant-numeric: lining-nums; }
#collection .lname { white-space: nowrap; }
#collection .lwords { color: var(--faint); text-transform: none; letter-spacing: .02em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
#collection .lmark { flex: none; width: 10px; height: 10px; position: relative; opacity: .35; transition: opacity .15s, transform .25s; }
#collection .lmark::before, #collection .lmark::after { content: ""; position: absolute; left: 0; top: 4.5px; width: 10px; height: 1px; background: var(--fg); }
#collection .lmark::after { transform: rotate(90deg); transition: transform .25s; }
#collection .line.open .lmark::after { transform: rotate(0deg); }
#collection .lhead:hover .lname { text-decoration: underline; text-underline-offset: 5px; }
#collection .lhead:hover .lwords { color: var(--muted); }
#collection .lhead:hover .lmark, #collection .line.open .lmark { opacity: 1; }
#collection .lvals { columns: 2; column-gap: 28px; padding: 2px 0 16px 46px; }
#collection .lval { display: flex; align-items: center; gap: 9px; width: 100%; padding: 3px 0; color: var(--muted); text-transform: uppercase; break-inside: avoid; }
#collection .lval:hover { color: var(--fg); }
#collection .lval .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#collection .lval .n em { font: italic 400 14px/1 var(--mark); text-transform: none; color: var(--faint); letter-spacing: .01em; }
#collection .lval .c { color: var(--faint); font-variant-numeric: tabular-nums; }
#collection .lval:hover .c { color: var(--muted); }
#collection .dot { flex: none; display: block; width: 8px; height: 8px; border-radius: 50%; margin: 0; opacity: 1; vertical-align: 0; background: none; }
#collection .dot.one { box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--gold); }
#collection .dot.ring { border: 1px solid var(--faint); }
#collection .qlinks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; text-transform: uppercase; color: var(--faint); }
#collection .qlinks a { text-decoration: none; }
#collection .qlinks a:hover { color: var(--muted); }

/* layout, filters, toolbar */
#collection .layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 34px; align-items: start; }
#collection .side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); max-height: calc(100vh - 32px); overflow-y: auto; padding-right: 6px; }
#collection .side::-webkit-scrollbar { width: 4px; }
#collection .side::-webkit-scrollbar-thumb { background: var(--dot); }
#collection .fhead { display: flex; justify-content: space-between; align-items: baseline; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
#collection .fhead button { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
#collection .group { border-bottom: 1px solid var(--line); }
#collection .gbtn { width: 100%; display: flex; justify-content: space-between; padding: 11px 0; text-transform: uppercase; color: var(--fg); }
#collection .gbtn span:last-child { color: var(--faint); }
#collection .vals { display: grid; gap: 1px; padding-bottom: 12px; }
#collection .val { display: flex; align-items: baseline; gap: 6px; width: 100%; text-align: left; color: var(--muted); padding: 2px 0; }
#collection .val .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#collection .val .lead { flex: 1; border-bottom: 1px dotted var(--dot); transform: translateY(-3px); min-width: 12px; }
#collection .val .c { color: var(--faint); font-variant-numeric: tabular-nums; }
#collection .val:hover, #collection .val.on { color: var(--fg); }
#collection .val.on .n::before { content: "■ "; }
#collection .val.on .c { color: var(--fg); }
#collection .bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-bottom: 14px; scroll-margin-top: 16px; }
#collection .tabs { display: flex; flex-wrap: wrap; gap: 4px; }
#collection .tab { padding: 5px 9px; text-transform: uppercase; color: var(--muted); border: 1px solid transparent; }
#collection .tab:hover { color: var(--fg); }
#collection .tab.on { background: var(--fg); color: var(--bg); }
#collection .tools { display: flex; align-items: center; gap: 14px; color: var(--muted); text-transform: uppercase; }
#collection .count b { color: var(--fg); font-weight: 400; font-variant-numeric: tabular-nums; }
#collection .goto { width: 74px; background: var(--bg); color: var(--fg); border: 1px solid var(--dot); font: inherit; padding: 4px 8px; text-transform: uppercase; }
#collection .ftoggle { display: none; padding: 5px 9px; border: 1px solid var(--dot); text-transform: uppercase; }
#collection .fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
#collection .fchips:empty { display: none; }
#collection .fchip { border: 1px solid var(--dot); padding: 3px 8px; color: var(--fg); text-transform: uppercase; }
#collection .fchip i { color: var(--faint); font-style: normal; }
#collection .fchip:hover { border-color: var(--fg); }

/* the grid */
#collection .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 22px 18px; align-content: start; box-sizing: border-box; }
#collection .card { display: block; text-align: left; width: 100%; text-decoration: none; min-width: 0; }
#collection .pic { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; box-sizing: border-box; background: var(--tile); border: 1px solid var(--line); overflow: hidden; transition: border-color .15s; }
#collection .pic canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .3s ease; }
#collection .pic canvas.ok { opacity: 1; }
#collection .card:hover .pic, #collection .card:focus-visible .pic { border-color: var(--fg); }
#collection .cap { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; text-transform: uppercase; font-variant-numeric: tabular-nums; }
#collection .cap b { font-weight: 400; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#collection .cap span { color: var(--faint); white-space: nowrap; }
#collection .sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
#collection .empty { color: var(--muted); text-transform: uppercase; padding: 60px 0; }

/* a work */
#collection .dtop { display: flex; flex-wrap: wrap; gap: 10px; text-transform: uppercase; color: var(--muted); margin: 34px 0 22px; }
#collection .dtop a { text-decoration: none; color: var(--fg); }
#collection .dgrid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: start; }
#collection .stage { position: relative; width: 100%; max-width: 100%; aspect-ratio: 4 / 5; max-height: calc(100vh - 140px); background: var(--tile); border: 1px solid var(--line); overflow: hidden; }
#collection .stage:fullscreen { max-height: none; border: 0; }
#collection .info { max-width: 520px; min-width: 0; }
#collection .code { color: var(--dim); text-transform: uppercase; }
#collection .title { font: 500 20px/1.3 var(--mono); letter-spacing: .02em; margin: 6px 0 2px; overflow-wrap: anywhere; }
#collection .by { color: var(--muted); text-transform: uppercase; }
#collection .ded { font: italic 400 19px/1.4 var(--mark); color: #e9e4d8; margin: 14px 0 0; overflow-wrap: anywhere; }
#collection .ded:empty { display: none; }
#collection .rule { border-top: 1px solid var(--line); margin: 22px 0; }
#collection .lbl { color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
#collection .big { font: 400 clamp(44px, 6vw, 64px)/1 var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#collection .big small { font-size: 16px; color: var(--muted); letter-spacing: .04em; }
#collection .kv { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; text-transform: uppercase; }
#collection .kv > span:first-child { color: var(--muted); white-space: nowrap; }
#collection .kv .lead { flex: 1; border-bottom: 1px dotted var(--dot); transform: translateY(-3px); min-width: 16px; }
#collection .kv b { font-weight: 400; text-align: right; }
#collection .kv em { font-style: normal; color: var(--faint); width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
#collection .kv em.one { color: var(--gold); }
#collection .row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 18px; }
#collection .btn { border: 1px solid var(--fg); padding: 7px 12px; text-transform: uppercase; text-decoration: none; color: var(--fg); }
#collection .btn:hover { background: var(--fg); color: var(--bg); }
#collection .link { text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; color: var(--muted); }
#collection .link:hover { color: var(--fg); }
#collection .pn { display: flex; justify-content: space-between; margin-top: 26px; text-transform: uppercase; color: var(--muted); }
#collection .pn a { text-decoration: none; }
#collection .pn a:hover { color: var(--fg); }
#collection .foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); text-transform: uppercase; }
#collection .foot .nav { gap: 18px; }

@media (max-width: 1100px) {
  #collection .hero { gap: 36px; }
  #collection .lvals { columns: 1; }
}
@media (max-width: 860px) {
  #collection .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #collection .side { position: static; max-height: none; overflow: visible; padding: 0 0 18px; }
  #collection .side.closed { display: none; }
  #collection .ftoggle { display: inline-block; }
  #collection .dgrid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  #collection .stage { max-height: none; }
  #collection .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 12px; }
  #collection .hero { grid-template-columns: minmax(0, 1fr); gap: 30px; margin-bottom: 56px; }
  #collection #c-hstage { height: auto; aspect-ratio: 4 / 5; }
  #collection .about { max-width: none; }
  #collection .lvals { columns: 2; padding-left: 0; }
}
@media (max-width: 560px) {
  #collection .lwords { display: none; }
  #collection .lname { flex: 1; }
  #collection .lvals { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { #collection * { transition: none !important; } }
