/* Signalform Studio. The frame is plain on purpose: the colour comes from the work on the shelf.
   Ported from comp B (concepts/b.html), picked by Mike 2026-10-24. */
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("fonts/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #f3f2ee;
  --ink: #121212;
  --ink-2: #5b5a56;
  --rule: #d9d7d0;
  --signal: #ff4f00;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --pad: clamp(20px, 3.4vw, 56px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; display: flex; flex-direction: column; }
body.grain { background-image: url("img/paper.webp"); background-size: 512px; }
p, li, dd, h1, h2, h3, label { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* top line */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px var(--pad); gap: 20px; }
.mark { padding: 10px 0; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.mark i { width: 13px; height: 13px; border-radius: 50%; background: var(--signal); display: block; flex: none; }
.mark b { font-weight: 500; color: var(--ink-2); }
.top nav { display: flex; gap: 28px; font-size: 15px; }
.top nav a { text-decoration: none; padding: 8px 0; }
.top nav a[aria-current] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.mono { font-family: var(--mono); font-size: 13px; }
.came { font-family: var(--mono); font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.came em { font-style: normal; color: var(--ink); background: linear-gradient(transparent 62%, rgba(255, 79, 0, .28) 62%); }
.ph { color: var(--ink-2); }
:is(h1,h2)[data-gpt] { border: 1.5px dashed var(--ink-2); color: var(--ink-2); padding: .1em .2em; border-radius: 4px; }
:not(h1,h2)[data-gpt] { border: 1.5px dashed var(--ink-2); color: var(--ink-2); font-family: var(--mono); font-size: 13px; padding: 10px 12px; border-radius: 4px; display: inline-block; }

.btn { display: inline-flex; align-items: center; gap: 10px; font: 600 16px var(--sans); text-decoration: none; padding: 14px 18px; background: var(--ink); color: var(--paper); border-radius: 4px; white-space: nowrap; transition: transform .15s var(--ease); }
.btn i { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); }
.btn:active { transform: translateY(1px); }
.link { font-weight: 600; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; text-decoration-color: var(--signal); }

/* a real build's screen: a thin edge, never a drawn device */
.screen { border-radius: 16px 16px 0 0; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgba(0, 0, 0, .14), 0 24px 50px -24px rgba(0, 0, 0, .35); aspect-ratio: 390 / 844; height: 100%; }
.screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* ── home: the shelf ── */
.shelf::-webkit-scrollbar { display: none; }
.head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--pad); padding: 3vh var(--pad) 0; align-items: end; }
.head h1 { font-size: clamp(36px, 4.4vw, 116px); line-height: 1; letter-spacing: -0.03em; font-weight: 700; margin-top: 16px; }
.head h1 .slot { font: inherit; letter-spacing: inherit; display: inline; padding: 0; text-align: inherit;  text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: .07em; text-underline-offset: .12em; cursor: pointer; }
@media (hover: hover) { .head h1 .slot:hover { color: var(--signal); } }
.meta { display: grid; grid-template-columns: auto 1fr; border-top: 1.5px solid var(--ink); font-size: 15px; }
.meta dt, .meta dd { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.meta dt { font-family: var(--mono); font-size: 13px; color: var(--ink-2); padding-right: 26px; padding-top: 11px; }
.shelf { flex: 1; display: flex; align-items: flex-end; justify-content: safe center; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; min-width: 0; gap: clamp(10px, 1.6vw, 26px); padding: 4vh var(--pad) 0; border-bottom: 10px solid var(--ink); min-height: 50vh; }
.obj { flex: 0 0 auto; display: block; padding: 0; cursor: pointer; transition: filter .4s, opacity .4s; filter: grayscale(1) contrast(.9); opacity: .55; position: relative; }
.obj:hover { opacity: .8; }
.obj .screen { display: block; height: 32vh; width: auto; transition: height .4s var(--ease); }
.obj.on { filter: none; opacity: 1; }
.obj.on .screen { height: 48vh; }
.obj .tag { position: absolute; left: 0; right: 0; top: -26px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--ink-2); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.obj.on .tag { opacity: 1; color: var(--ink); }
.obj:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.foot { display: flex; justify-content: space-between; align-items: center; padding: 16px var(--pad) 22px; gap: 20px; flex-wrap: wrap; }

.fam { height: 26px; width: auto; vertical-align: -8px; margin-right: 10px; }

/* ── work: the register ── */
.lede { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--pad); padding: 3vh var(--pad) 4vh; align-items: end; }
.lede p { max-width: 52ch; font-size: 18px; line-height: 1.45; }
.open .txt .link { padding: 8px 0; align-self: flex-start; }
.lede h1 { font-size: clamp(34px, 4vw, 104px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; }
.reg { margin: 0 var(--pad); border-top: 2px solid var(--ink); }
.row { display: grid; grid-template-columns: 70px minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1fr) 110px 30px; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--rule); align-items: baseline; cursor: pointer; font-size: 17px; width: 100%; text-align: left; }
.row > span { text-wrap: balance; }
@media (max-width: 1100px) { .row { grid-template-columns: 60px minmax(0, 1.3fr) minmax(0, 1.2fr) 90px 30px; } .row .k { display: none; } }
.row .n, .row .s { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.row .m { font-weight: 600; }
.row .k { color: var(--ink-2); }
.row .go { text-align: right; }
.row:hover .m { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.row.here { border-bottom: 0; }
.row.here .n { color: #c23a00; }
.open { display: grid; grid-template-columns: 70px 200px minmax(0, 1fr) minmax(0, .8fr); gap: 18px; padding: 6px 0 26px; border-bottom: 1px solid var(--rule); }
.open .screen { width: 200px; height: auto; border-radius: 16px; }
.open .desk { border-radius: 8px; overflow: hidden; aspect-ratio: 1440 / 900; box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); align-self: start; }
.open .desk img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.open .txt { font-size: 16px; line-height: 1.45; display: flex; flex-direction: column; gap: 14px; }

/* ── practice ── */
.page { padding: 3vh var(--pad) 8vh; }
.page h1 { font-size: clamp(34px, 4vw, 66px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; max-width: 20ch; margin-bottom: 5vh; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pad); border-top: 2px solid var(--ink); padding-top: 22px; }
.cols h2 { font-size: 19px; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.01em; }
.cols p { font-size: 17px; line-height: 1.5; }

/* ── talk ── */
.talk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--pad); padding: 3vh var(--pad) 8vh; align-items: start; }
.talk h1 { font-size: clamp(34px, 4vw, 66px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; margin-bottom: 18px; }
.talk .lede-p { font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 34ch; }
form.ask { border-top: 2px solid var(--ink); display: flex; flex-direction: column; }
form.ask label { display: grid; grid-template-columns: 250px 1fr; gap: 18px; border-bottom: 1px solid var(--rule); padding: 14px 0; align-items: baseline; }
form.ask label span { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
form.ask input, form.ask textarea { padding: 8px 0; font: 18px/1.45 var(--sans); color: var(--ink); background: transparent; border: 0; outline: none; width: 100%; resize: vertical; }
form.ask textarea { min-height: 7.5em; }
form.ask input:focus, form.ask textarea:focus { box-shadow: 0 2px 0 var(--signal); }
form.ask .trap { position: absolute; left: -9999px; }
form.ask .send { display: flex; gap: 18px; align-items: center; padding-top: 22px; flex-wrap: wrap; }
form.ask .note { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }

/* ── look inside: one build's preview ── */
.acts { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.obj.on { cursor: zoom-in; }
.link.look { padding: 0; text-align: left; }
html.seeing { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--paper); background-image: url("img/paper.webp"); background-size: 512px; overflow-y: auto; overscroll-behavior: contain; opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .25s var(--ease), transform .3s var(--ease), visibility 0s .3s; display: flex; flex-direction: column; }
.sheet:focus { outline: none; }
.sheet.on { opacity: 1; visibility: visible; transform: none; transition: opacity .25s var(--ease), transform .3s var(--ease); }
.sheet-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px var(--pad); position: sticky; top: 0; background: color-mix(in srgb, var(--paper) 92%, transparent); z-index: 1; }
.sheet .back { font: 600 15px var(--sans); padding: 10px 0; }
.sheet .back:focus:not(:focus-visible) { outline: none; }
.sheet-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px var(--pad); padding: 1vh var(--pad) 3vh; align-items: end; }
.sheet-head .came { grid-column: 1 / -1; }
.sheet-head h2 { font-size: clamp(30px, 3.6vw, 64px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; }
.sheet-head .note { grid-column: 1 / -1; }
.facts { display: grid; grid-template-columns: auto 1fr; border-top: 1.5px solid var(--ink); font-size: 15px; }
.facts dt, .facts dd { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--mono); font-size: 13px; color: var(--ink-2); padding-right: 22px; padding-top: 11px; }
.strip { display: flex; gap: clamp(12px, 1.6vw, 24px); overflow-x: auto; padding: 0 var(--pad) 5vh; scroll-snap-type: x mandatory; scrollbar-width: thin; flex: 1; align-items: flex-start; }
.grab { flex: 0 0 auto; scroll-snap-align: start; margin: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .14), 0 24px 50px -24px rgba(0, 0, 0, .35); background: #000; }
.grab img { display: block; height: min(64vh, 620px); width: auto; }
.grab.desktop { border-radius: 8px; }
@media (max-width: 760px) {
  .sheet-head { grid-template-columns: 1fr; }
  .grab img { height: min(62vh, 520px); }
  .grab.desktop img { height: auto; width: calc(100vw - 2 * var(--pad)); }
  .acts { width: 100%; }
}

/* ── editing (Mike only) ── */
.nw { white-space: nowrap; }
.editbar { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 20px); width: max-content; position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; display: flex; gap: 6px; align-items: center; background: var(--ink); color: var(--paper); padding: 6px; border-radius: 6px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .5); font-size: 15px; }
.editbar button { padding: 10px 14px; border-radius: 4px; color: var(--paper); font-weight: 600; }
.editbar button.go { background: var(--signal); color: #fff; }
.editbar .st:empty { display: none; }
.editbar .st { flex-basis: 100%; order: -1; text-align: center; padding: 4px 6px 2px; font-family: var(--mono); font-size: 12px; padding: 0 10px; color: #bbb; white-space: nowrap; }
body.editing [data-k] { outline: 1px dashed rgba(255, 79, 0, .6); outline-offset: 3px; cursor: text; }
body.editing [data-k]:focus { outline: 2px solid var(--signal); }
.history { position: fixed; right: 18px; bottom: 80px; z-index: 50; background: var(--paper); border: 1.5px solid var(--ink); width: min(360px, calc(100vw - 36px)); max-height: 50vh; overflow: auto; font-size: 14px; }
.history button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.history button:hover { background: #fff; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr !important; }
  .top nav { gap: 16px; font-size: 14px; }
  .mark b { display: none; }
  .head { display: contents; }
  .head > div { padding: 6px var(--pad) 0; }
  .head h1 { font-size: 34px; }
  .meta { order: 3; margin: 22px var(--pad) 0; }
  .shelf { order: 2; }
  .foot { order: 4; }
  .shelf { justify-content: flex-start; overflow-x: auto; min-height: 0; padding-top: 34px; scrollbar-width: none; scroll-snap-type: x proximity; }
    .obj { scroll-snap-align: center; } .obj .screen { height: 250px; } .obj.on .screen { height: 380px; }
  .lede { grid-template-columns: 1fr; gap: 16px; padding-top: 10px; }
  .row { grid-template-columns: 36px 1fr 22px; gap: 10px; font-size: 16px; }
  .row .f, .row .k, .row .s { display: none; }
  .open { grid-template-columns: 36px 140px 1fr; gap: 10px; }
  .open .screen { width: 140px; } .open .desk { display: none; }
  .cols { grid-template-columns: 1fr; }
  .talk { grid-template-columns: 1fr; }
  form.ask label { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
