/* Signalform Kits. The studio's paper, ink, mono and signal orange (from /talk and /start), light and dark. */
@font-face { font-family: "DM Mono"; src: url("/kits/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
:root, [data-theme="light"] { --paper: #f3f2ee; --ink: #121212; --ink-2: #5b5a56; --rule: #cfccc4; --signal: #ff4f00; --sig-ink: #c23c00; --dust1: #c4c1b8; --dust2: #a19e95; --code: #e9e7e1; }
[data-theme="dark"] { --paper: #111110; --ink: #ecebe6; --ink-2: #8d8a83; --rule: #2b2a28; --signal: #ff4f00; --sig-ink: #ff7a3d; --dust1: #2c2b29; --dust2: #45433f; --code: #191918; }
:root { --mono: "DM Mono", ui-monospace, Menlo, monospace; --pad: clamp(20px, 3.4vw, 56px); --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--paper); color: var(--ink); font-family: var(--mono); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: none; }
#ground { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.top, .frame, .barfiles { position: relative; z-index: 1; }
h1 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: left; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the bar: studio name home, kits, dark */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px var(--pad); flex: none; }
.top nav { display: flex; gap: clamp(14px, 2.4vw, 36px); }
.q, .door, .back { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.q { color: var(--ink-2); text-decoration-color: var(--rule); }
.q b { color: var(--signal); font-weight: 400; }
@media (hover: hover) { .q:hover, .back:hover { color: var(--ink); text-decoration-color: var(--signal); } }

/* the column */
.frame { flex: 1; min-height: 0; width: 100%; display: flex; justify-content: center; padding: 0 var(--pad); }
.stage { width: 100%; max-width: 760px; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 2vh 0 8vh; min-height: 0; }
.stage.in { animation: in .34s var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stage.in { animation: none; } }
.kick { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.kick i { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); display: block; flex: none; }
.stage h1 { font-size: clamp(30px, 4.2vw, 84px); line-height: 1.08; letter-spacing: -0.035em; }
.stage.ask h1 { font-size: clamp(26px, 3vw, 56px); }
.lede { font-size: clamp(17px, 1.3vw, 25px); line-height: 1.5; color: var(--ink); max-width: 44ch; }
.fine { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); max-width: 56ch; letter-spacing: .01em; }
.fine b { font-weight: 400; color: var(--ink); }
.doors { display: flex; gap: 10px clamp(20px, 3vw, 48px); flex-wrap: wrap; align-items: center; }
.door { font-size: 15px; text-decoration-color: var(--signal); min-height: 48px; transition: transform .35s var(--spring); }
.door::before { content: "→"; color: var(--signal); }
.door.quiet { font-size: 13px; color: var(--ink-2); text-decoration-color: var(--rule); }
.door.quiet::before { content: none; }
.door:active { transform: scale(.95); }
.door:disabled { opacity: .45; }
.back { color: var(--ink-2); text-decoration-color: var(--rule); }
.back::before { content: "←"; color: var(--signal); }
.note { font-size: 13px; color: var(--sig-ink); min-height: 1.3em; }

/* the list of kits */
.kits { list-style: none; border-top: 1px solid var(--rule); }
.kits li { border-bottom: 1px solid var(--rule); }
.kit { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; padding: 16px 0 18px; text-decoration: none; }
.k-name { font-size: clamp(16px, 1.2vw, 22px); letter-spacing: .06em; text-transform: uppercase; text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.k-name::before { content: "→ "; color: var(--signal); }
.k-price { font-size: 14px; color: var(--ink-2); align-self: center; grid-row: span 2; font-variant-numeric: tabular-nums; }
.k-line { font-size: clamp(14px, 1vw, 18px); line-height: 1.5; color: var(--ink); }

/* questions */
.answer { display: grid; gap: 10px; }
.answer input, .answer textarea { width: 100%; font-size: clamp(17px, 1.2vw, 22px); padding: 10px 0; border: 0; border-bottom: 1px solid var(--ink-2); border-radius: 0; background: transparent; caret-color: var(--signal); }
.answer textarea { resize: none; line-height: 1.5; height: calc(1.5em * 4 + 22px); }
.answer input:focus, .answer textarea:focus { outline: none; border-bottom: 2px solid var(--signal); padding-bottom: 9px; }
.answer ::placeholder { color: var(--ink-2); opacity: .7; }
.opts { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.opt { width: 100%; display: grid; grid-template-columns: 3ch 1fr; gap: 2px 10px; padding: 11px 0 12px; border-bottom: 1px solid var(--rule); }
.opt .m { color: var(--ink-2); font-size: 15px; }
.opt.on .m { color: var(--signal); }
.opt .l { font-size: clamp(15px, 1.05vw, 19px); }
.opt .d { grid-column: 2; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.opt .d b { font-weight: 400; color: var(--sig-ink); letter-spacing: .06em; }
@media (hover: hover) { .opt:hover .l { text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 5px; } }
.steps { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

/* the bench: the files being written */
.bench { display: none; flex-direction: column; min-height: 0; gap: 12px; }
.bench .head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.bench .head b { color: var(--ink); font-weight: 400; }
.tree { list-style: none; font-size: 13px; line-height: 1.25; display: grid; gap: 0; max-height: 34%; overflow: auto; border-top: 1px solid var(--rule); scrollbar-width: thin; flex: none; }
.tree button { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.tree button .n { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tree button.on { color: var(--ink); }
.tree button.on .p::before { content: "● "; color: var(--signal); }
.tree button.hot .p { color: var(--sig-ink); }
.what { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); min-height: 3em; }
.code { flex: 1; min-height: 0; overflow: auto; background: var(--code); padding: 14px 16px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; }
.code .hot { color: var(--sig-ink); transition: color 1.6s; }
.code .more { color: var(--ink-2); display: block; margin-top: 10px; }
.code .more::before { content: "··· "; color: var(--signal); }
.copyrow { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }

/* phone: the files are a door at the bottom */
.barfiles { flex: none; display: flex; justify-content: center; padding: 0 var(--pad) calc(6px + env(safe-area-inset-bottom)); }
.barfiles[hidden] { display: none; }

/* the files as their own screen (phone) */
.stage.files { max-width: 900px; justify-content: flex-start; padding-top: 1vh; padding-bottom: 2vh; }
.stage.files .bench { display: flex; flex: 1; }

/* big screens: the question on the left, the bench on the right */
@media (min-width: 1100px) {
  .frame.wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: calc(var(--pad) * 1.6); }
  .frame.wide .stage { max-width: 640px; justify-self: end; }
  .frame.wide > .bench { display: flex; padding: 6vh 0 7vh; height: 100%; }
  .barfiles { display: none; }
}
@media (max-width: 640px) {
  .stage { padding-bottom: 3vh; gap: 18px; }
  .kit { grid-template-columns: 1fr; }
  .k-price { grid-row: auto; }
  .top { padding-top: 2px; }
}
@media (max-height: 700px) and (max-width: 640px) { .stage.ask h1 { font-size: 23px; } .opt { padding: 8px 0 9px; } .answer textarea { height: calc(1.5em * 3 + 22px); } }
.curx { font-size: inherit; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; padding: 10px 2px; }
@media (hover: hover) { .curx:hover { color: var(--ink); text-decoration-color: var(--signal); } }
.curx { padding: 7px 2px; }
@media (max-width: 640px) { .kit { padding: 12px 0 13px; gap: 4px; } .stage.list { gap: 14px; } }
@media (max-width: 640px) and (max-height: 780px) { .stage.list .lede { font-size: 16px; } }
/* wide screens use the window: the kits sit side by side, the door and the about open up, the question fills its half */
@media (min-width: 1100px) {
  .frame.wide .stage { max-width: none; justify-self: stretch; }
  .stage.list, .stage.doorv, .stage.about, .stage.plain { max-width: 88vw; }
  .stage.list .kits { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: calc(var(--pad) * 1.2); border-top: 0; }
  .stage.list .kits li { border-top: 1px solid var(--rule); }
  .stage.list .kit { grid-template-columns: 1fr; height: 100%; align-content: start; }
  .stage.list .k-price { grid-row: auto; align-self: start; }
  .stage.doorv { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: calc(var(--pad) * 1.6); align-content: center; }
  .stage.doorv > * { grid-column: 1; }
  .stage.doorv .lede { grid-column: 2; grid-row: 2 / span 3; align-self: center; justify-self: end; max-width: 32ch; font-size: clamp(20px, 1.7vw, 40px); }
  .stage.about .lede { max-width: 64ch; }
}
