/* Sohne — the site's typeface, served from /fonts (../../fonts from /mite/css/) */
@font-face { font-family: 'Sohne'; src: url('../../fonts/Sohne-Leicht.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sohne'; src: url('../../fonts/Sohne-LeichtKursiv.woff2') format('woff2'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Sohne'; src: url('../../fonts/Sohne-Buch.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sohne'; src: url('../../fonts/Sohne-BuchKursiv.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Sohne'; src: url('../../fonts/Sohne-Kraftig.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sohne'; src: url('../../fonts/Sohne-KraftigKursiv.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --bg: #ffffff; --surface: #fafafa; --surface2: #f1f1f1; --line: #e2e2e2; --ink: #0a0a0a; --muted: #6b6b6b; --faint: #a0a0a0;
  --famA: #2a3cff; --famB: #ff1f4f; --famG: #00c865; --neon: #00ff85; --accent: #0a0a0a; --warn: #ff1f4f; --ok: #00a653;
  --sans: 'Sohne', 'Helvetica Neue', Helvetica, Arial, sans-serif; --mono: 'Sohne', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --panel-w: 360px;
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #0b0b0b; --surface2: #151515; --line: #262626; --ink: #ffffff; --muted: #9a9a9a; --faint: #666666;
  --famA: #5b6bff; --famB: #ff3d6a; --famG: #00ff85; --neon: #00ff85; --accent: #e8eaed; --warn: #ff3d6a; --ok: #00ff85;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); overflow: hidden; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.top { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { text-decoration: none; font-weight: 500; letter-spacing: 0.04em; }
.sep { color: var(--faint); }
.title em { font-style: normal; color: var(--muted); }
.pill { font: 11px var(--mono); letter-spacing: 0.03em; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.links { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 13px; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--ink); }
.ghost { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; cursor: pointer; color: var(--muted); }
.ghost:hover { color: var(--ink); }
.ghost.small { font-size: 11px; padding: 1px 6px; }

.app { display: grid; grid-template-columns: 1fr var(--panel-w); height: calc(100% - 44px); }
.stage { position: relative; background: radial-gradient(ellipse at 40% 30%, var(--surface) 0%, var(--bg) 70%); }
#gl { width: 100%; height: 100%; display: block; }
.hud { position: absolute; font: 12px/1.4 var(--mono); letter-spacing: 0.02em; color: var(--muted); pointer-events: none; }
.hud-tl { top: 12px; left: 14px; }
.hud-tr { top: 12px; right: 14px; text-align: right; }
.hud-bl { bottom: 10px; left: 14px; right: 14px; display: flex; flex-direction: column; gap: 6px; }
.hint { color: var(--faint); }
.legend { display: inline-flex; align-items: center; gap: 8px; pointer-events: none; }
.legend i { display: inline-block; width: 160px; height: 8px; border-radius: 3px; border: 1px solid var(--line); }
.legend b { font-weight: 400; color: var(--ink); margin-left: 6px; }
.hidden { display: none !important; }

.drop { position: absolute; inset: 12px; border: 2px dashed var(--ink); border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: var(--ink); background: color-mix(in srgb, var(--bg) 80%, transparent); pointer-events: none; }
.busy { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; font: 12px var(--mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.busy span { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--neon); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 5; }
.boot-card { width: min(380px, 80%); }
.boot-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 500; letter-spacing: 0.04em; }
.boot-card p { margin: 0 0 12px; color: var(--muted); }
.boot-card small { display: block; margin-top: 8px; font: 11px var(--mono); color: var(--faint); min-height: 1.4em; }
.bar { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--neon); transition: width 0.15s; }

.panel { overflow-y: auto; border-left: 1px solid var(--line); background: var(--bg); }
.block { padding: 14px 16px 16px; border-bottom: 1px solid var(--line); }
.block h2 { margin: 0 0 10px; font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.block h2 small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.row { display: flex; align-items: center; gap: 10px; margin: 6px 0; flex-wrap: nowrap; }
.row.wrap { flex-wrap: wrap; }
.row label { color: var(--muted); font-size: 12px; min-width: 0; }
.row .unit, .gh .unit { color: var(--faint); font-size: 11px; }
.row.slider label { width: 120px; flex: none; }
.row.slider input[type=range] { flex: 1; accent-color: var(--ink); min-width: 60px; }
.row.slider output { width: 42px; text-align: right; font: 12px var(--mono); color: var(--ink); }
.row select { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.toggles { flex-wrap: wrap; gap: 6px 14px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
/* component strip: which plugin component a block runs, with its Grasshopper icon */
.gh { display: flex; align-items: center; gap: 6px; margin: -2px 0 10px; font-size: 11.5px; color: var(--muted); min-height: 24px; }
.gh img { width: 24px; height: 24px; flex: none; image-rendering: auto; }
.gh img + img { margin-left: -4px; }
.gh span { margin-left: 2px; }
.gh b { color: var(--ink); font-weight: 500; }
.gh.hidden { display: none; }
.chips.small { margin-bottom: 0; gap: 4px; }
.chips.small button { padding: 2px 8px; font-size: 11.5px; }
/* what the markers in the viewport mean, listed only when they are there */
.legend { font-size: 11.5px; color: var(--muted); margin: 4px 0 6px; line-height: 1.5; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; }
.legend i.knob { border-radius: 50%; }
.legend b { color: var(--ink); font-weight: 500; }
.legend.hidden { display: none; }
#seed-label { white-space: nowrap; }
.ci.s { width: 15px; height: 15px; margin-right: 3px; vertical-align: -3px; }
.mark { width: 20px; height: 20px; margin: 0 -2px 0 2px; }
/* the knot mark is black on transparent: invert it on the dark theme */
:root[data-theme="dark"] .mark, :root[data-theme="dark"] #dl-recipe .ci { filter: invert(1); }
.chips button:hover { color: var(--ink); border-color: var(--muted); }
.chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips button:disabled { opacity: 0.4; cursor: not-allowed; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.btn:hover { border-color: var(--muted); }
.btn.file input { display: none; }
.num { width: 64px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: 12px var(--mono); }
.mono { font: 12px var(--mono); }
.note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.stats { margin: 6px 0 0; font: 12px/1.6 var(--mono); color: var(--muted); white-space: pre-wrap; }
.stats b { color: var(--ink); font-weight: 500; }
.warn { margin: 6px 0 0; font-size: 12px; color: var(--warn); }
.plot { width: 100%; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; }
.caption { font-size: 11px; color: var(--faint); margin-top: 3px; }
.recipe { margin: 8px 0 0; padding: 8px 10px; background: var(--surface2); border-radius: 6px; font: 12px/1.5 var(--mono); white-space: pre-wrap; user-select: all; }
.foot { padding: 14px 16px 24px; font-size: 12px; color: var(--muted); }
.ok { color: var(--ok); }
.bad { color: var(--warn); }

@media (max-width: 860px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .stage { height: 62vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .links a { display: none; }
}

/* camera + hover + quality card */
.cam { position: absolute; right: 14px; bottom: 34px; display: flex; gap: 4px; }
.cam button { font: 11px var(--sans); letter-spacing: 0.04em; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 3px 9px; cursor: pointer; }
.cam button:hover { color: var(--ink); border-color: var(--muted); }
.hud-hover { top: 34px; left: 14px; color: var(--ink); }
.busy button { pointer-events: auto; margin-left: 4px; }
.busy { pointer-events: auto; }
.presets { gap: 6px; }
.presets .unit { margin-left: auto; }
.sw { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; }
.swA { background: var(--famA); } .swB { background: var(--famB); } .swG { background: var(--famG); }
.quality { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 10px; }
.q-h { font-size: 12px; color: var(--muted); }
.q-h span { color: var(--ink); }
.mini { width: 100%; height: 44px; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; margin-top: 4px; }
.ends { font-size: 12px; color: var(--muted); line-height: 1.7; }
.ends i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.buildbar { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; margin-top: 8px; border: 1px solid var(--line); }
.buildbar i { display: block; height: 100%; background: var(--neon); }
.btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chk.dim { opacity: 0.45; }
.chk.dim { opacity: 0.45; }

/* shape picker: symbol · name · formula, grouped by curvature class */
.shape-current, .sitem { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
.shape-current { grid-template-columns: auto 1fr auto; padding: 10px 12px; }
.shape-current:hover, .sitem:hover { border-color: var(--ink); }
.shape-current.open { border-color: var(--ink); }
.shape-current .chev { color: var(--muted); font-size: 12px; transition: transform 0.15s; }
.shape-current.open .chev { transform: rotate(180deg); }
.sym { display: grid; place-items: center; color: var(--ink); }
.sym svg { display: block; }
.txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nm { font-size: 14px; font-weight: 500; letter-spacing: 0.01em; display: flex; align-items: center; gap: 6px; }
.nm em { font-style: normal; font-weight: 400; font-size: 10.5px; letter-spacing: 0.04em; color: var(--muted); margin-left: auto; white-space: nowrap; }
.fx { font-size: 12px; font-weight: 300; color: var(--muted); font-feature-settings: "tnum" 1; overflow-wrap: anywhere; line-height: 1.35; }
.cls { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cls.neg { background: var(--famA); } .cls.pos { background: var(--famB); } .cls.zero { background: var(--famG); }
.cls.mixed { background: linear-gradient(90deg, var(--famA) 50%, var(--famB) 50%); } .cls.free { background: none; border: 1px solid var(--muted); }
.shape-list { margin-top: 8px; max-height: 60vh; overflow-y: auto; padding-right: 2px; }
.sgroup { margin: 10px 0 4px; }
.sgroup h3 { margin: 0 0 6px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
.sgroup h3 small { display: block; margin-top: 2px; font-size: 11px; font-weight: 300; letter-spacing: 0; text-transform: none; color: var(--muted); }
.sitem { border-color: transparent; margin: 1px 0; padding: 6px 10px; }
.sitem.on { border-color: var(--ink); background: var(--surface); }
.sitem.on .nm { font-weight: 500; }

.kitview { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.kitview img { width: 100%; display: block; }
#ksheetw, #ksheeth { width: 5.5em; }
