/* Demos and case-study cards. Loaded only by /work and /demos/* pages. */

/* ---------- page helpers ---------- */
.page-hero h1.h1-md { font-size: clamp(44px, 7.4vw, 116px); line-height: .94; max-width: 17ch; }
.sample-chip {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; padding: 9px 14px;
  border: 1px dashed currentColor; border-radius: 999px; color: var(--accent-deep);
  font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.sample-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sample-note { margin-top: clamp(40px, 5vw, 72px); padding-top: 26px; border-top: 1px solid var(--line-strong); display: grid; grid-template-columns: 210px 1fr; gap: clamp(16px, 3vw, 48px); }
.sample-note .label { color: var(--accent-deep); padding-top: .4em; }
.sample-note p:last-child { color: var(--muted); max-width: 640px; }

/* ---------- case cards (on /work) ---------- */
.cases { margin-top: clamp(40px, 6vw, 88px); padding-top: 28px; border-top: 1px solid var(--line-dk); display: grid; gap: 28px; }
.cases-head { display: grid; gap: 12px; max-width: 580px; }
.cases-head .label { color: var(--accent); }
.cases-head h3 { font: 400 clamp(32px, 4vw, 56px)/1.02 var(--serif); letter-spacing: -.02em; color: var(--paper); }
.cases-head p:last-child { color: var(--muted-dk); }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.case-card {
  display: grid; gap: 14px; align-content: start; padding: 26px; color: var(--paper);
  border: 1px solid var(--line-dk); border-radius: 6px; background: var(--ink-2);
  transition: border-color .3s, transform .45s var(--ease);
}
.case-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.case-card .label { color: var(--accent); }
.case-card h4 { margin: 0; font: 400 clamp(26px, 2.6vw, 36px)/1.08 var(--serif); letter-spacing: -.015em; }
.case-card p:not(.label) { color: var(--muted-dk); font-size: 15px; }
.case-go { display: inline-flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.case-go svg { width: 14px; height: 14px; transition: transform .35s var(--ease); }
.case-card:hover .case-go svg { transform: translate(3px, -3px); }

/* ---------- takeoff demo ---------- */
.tk-section { padding-top: clamp(48px, 6vw, 88px); }
.tk-intro { display: grid; grid-template-columns: 210px 1fr; gap: clamp(16px, 3vw, 48px); margin-bottom: clamp(24px, 3vw, 40px); align-items: start; }
.tk-intro .label { color: var(--accent); padding-top: .4em; }
.tk-intro p:last-child { color: var(--muted-dk); max-width: 560px; font-size: 18px; }
.takeoff { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 32px); align-items: start; }

.tk-sheet-wrap { background: var(--ink-2); border: 1px solid var(--line-dk); border-radius: 6px; padding: clamp(14px, 2vw, 24px); position: sticky; top: calc(var(--header-h) + 12px); }
.tk-sheet-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; font: 500 11px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-dk); }
.tk-sheet-bar b { color: var(--paper); font-weight: 500; }
.tk-sheet { background: var(--paper); border-radius: 3px; padding: 10px; color: var(--ink); }
.tk-sheet svg { width: 100%; height: auto; display: block; }
.tk-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font: 500 10.5px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted-dk); }
.tk-legend span { display: inline-flex; align-items: center; gap: 8px; }
.tk-legend i { width: 14px; height: 14px; border: 1.5px solid var(--paper); background: rgba(241, 237, 228, .18); }
.tk-legend i.rev { border-color: var(--accent); border-style: dashed; background: rgba(240, 80, 30, .35); }
.tk-legend i.ver { background: var(--paper); }

.tk-sheet .wall { fill: none; stroke: var(--ink); stroke-width: 3; }
.tk-sheet .fixt { fill: none; stroke: rgba(18, 21, 19, .4); stroke-width: 1.2; }
.tk-sheet .cut { fill: var(--paper); }
.tk-sheet .note { font: 500 9px var(--mono); letter-spacing: .08em; fill: rgba(18, 21, 19, .6); }
.piece { cursor: pointer; outline: none; }
.piece .fill { fill: rgba(18, 21, 19, .1); stroke: var(--ink); stroke-width: 1.6; transition: fill .3s, stroke .3s, stroke-width .2s; }
.piece .tagc { fill: var(--ink); transition: fill .3s; }
.piece .tagt { fill: var(--paper); font: 600 10px var(--mono); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.piece.is-review .fill { fill: rgba(240, 80, 30, .3); stroke: var(--accent-deep); stroke-dasharray: 5 3; }
.piece.is-review .tagc { fill: var(--accent); }
.piece.is-review .tagt { fill: var(--ink); }
.piece.is-human .fill { fill: rgba(18, 21, 19, .22); }
.piece:hover .fill, .piece:focus-visible .fill { stroke-width: 2.8; }
.piece.is-selected .fill { stroke-width: 3.2; }
.piece:focus-visible .tagc { stroke: var(--accent); stroke-width: 3; }

.tk-side { display: grid; gap: 16px; min-width: 0; }
.tk-card { background: var(--ink-2); border: 1px solid var(--line-dk); border-radius: 6px; padding: clamp(16px, 2vw, 24px); color: var(--paper); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tk-label { color: var(--accent); }
.tk-ctl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tk-ctl-head label { font: 500 11px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.tk-ctl-head output { font: 400 40px/1 var(--serif); color: var(--accent); }
.tk-range { width: 100%; accent-color: var(--accent); margin: 0; }
.tk-hint { color: var(--muted-dk); font-size: 14px; }
.tk-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-pill { padding: 7px 11px; border: 1px solid var(--line-dk); border-radius: 999px; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-dk); }
.tk-pill b { color: var(--paper); font-weight: 500; }
.tk-pill.rev b { color: var(--accent); }

.tk-list { display: grid; border-top: 1px solid var(--line-dk); }
.tk-row { border-bottom: 1px solid var(--line-dk); padding: 12px 8px; margin-inline: -8px; display: grid; gap: 10px; outline: none; border-radius: 4px; transition: background .25s; }
.tk-row.is-selected { background: rgba(241, 237, 228, .06); }
.tk-row:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.tk-row-main {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; width: 100%;
  background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.tk-row-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.tk-tag { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); color: var(--ink); font: 600 10px/1 var(--mono); }
.is-review .tk-tag { background: var(--accent); }
.tk-name { font-size: 15px; }
.tk-dims, .tk-area { font: 500 12px/1.4 var(--mono); color: var(--muted-dk); white-space: nowrap; }
.tk-area { color: var(--paper); min-width: 62px; text-align: right; }
.tk-conf { display: grid; grid-template-columns: minmax(0, 1fr) 40px auto; gap: 12px; align-items: center; padding-left: 44px; }
.tk-meter { height: 4px; border-radius: 2px; background: rgba(241, 237, 228, .14); position: relative; overflow: hidden; }
.tk-meter::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--paper); border-radius: 2px; }
.is-review .tk-meter::after { background: var(--accent); }
.tk-conf b { font: 500 12px/1 var(--mono); }
.tk-badge { font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; font-style: normal; color: var(--muted-dk); white-space: nowrap; }
.is-review .tk-badge { color: var(--accent); }
.is-human .tk-badge { color: var(--paper); }
.tk-reason { padding-left: 44px; font-size: 14px; }
.tk-actions, .tk-correct { padding-left: 44px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tk-correct label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted-dk); }
.tk-input { width: 78px; padding: 8px 9px; border: 1px solid var(--line-dk); border-radius: 6px; background: var(--ink); color: var(--paper); font: 500 13px/1 var(--mono); }
.tk-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-btn { padding: 9px 14px; border: 1px solid var(--line-dk); border-radius: 999px; background: none; color: var(--paper); font: 500 12.5px/1 var(--sans); cursor: pointer; transition: background .25s, color .25s, border-color .25s; }
.tk-btn:hover { border-color: var(--paper); }
.tk-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.tk-btn.primary:hover { background: var(--paper); border-color: var(--paper); }

.tk-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tk-stat b { display: block; font: 400 clamp(30px, 3.2vw, 44px)/1 var(--serif); letter-spacing: -.02em; }
.tk-stat span { display: block; margin-top: 6px; font: 500 10.5px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted-dk); }
.tk-release { display: grid; gap: 10px; justify-items: start; padding-top: 14px; border-top: 1px solid var(--line-dk); }
.tk-result { padding: 14px 16px; border: 1px solid var(--accent); border-radius: 6px; color: var(--accent); font: 500 12.5px/1.5 var(--mono); letter-spacing: .04em; outline: none; }
.tk-log-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tk-log { display: grid; gap: 7px; }
.tk-log li { position: relative; padding-left: 18px; font: 500 12px/1.5 var(--mono); color: var(--muted-dk); }
.tk-log li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); }
.tk-log li:first-child { color: var(--paper); }

@media (max-width: 1000px) {
  .takeoff { grid-template-columns: 1fr; }
  .tk-sheet-wrap { position: static; }
  .tk-intro, .sample-note { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 560px) {
  .tk-row-main { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .tk-dims { display: none; }
  .tk-conf { padding-left: 0; }
  .tk-reason, .tk-actions, .tk-correct { padding-left: 0; }
  .tk-totals { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .tk-release .btn { width: 100%; }
  .tk-badge { font-size: 9px; }
}

/* ---------- featured demo card (shared by /work and the homepage) ---------- */
.feat {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: clamp(24px, 3.4vw, 52px); border: 1px solid var(--line-dk); border-radius: 8px; color: var(--paper);
  background-color: var(--ink-2); background-image: radial-gradient(rgba(241, 237, 228, .07) 1px, transparent 1px); background-size: 22px 22px;
  transition: border-color .35s;
}
.feat:hover { border-color: var(--accent); }
.feat-copy { display: grid; gap: 18px; justify-items: start; }
.feat-copy .label { color: var(--accent); }
.feat-copy h3 { font: 400 clamp(40px, 5vw, 78px)/.95 var(--serif); letter-spacing: -.03em; }
.feat-copy h3 em { color: var(--accent); }
.feat-copy p:not(.label) { color: var(--muted-dk); max-width: 440px; font-size: 17px; }
.feat:hover .btn-accent { background: var(--paper); }
.feat-viz { margin: 0; }
.feat-viz svg { width: 100%; height: auto; display: block; }
.feat-viz figcaption { margin-top: 12px; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-dk); }
.feat-viz .fl { font: 500 9.5px var(--mono); letter-spacing: .08em; fill: rgba(241, 237, 228, .6); }
.feat-viz .fs { font: 500 7.5px var(--mono); letter-spacing: .05em; fill: rgba(241, 237, 228, .5); text-anchor: middle; }
.feat-viz .fn { font: 400 38px var(--serif); fill: var(--paper); letter-spacing: -.02em; text-anchor: end; }
.feat-viz .fn.on { fill: var(--accent); }
.feat-viz .row-line { stroke: rgba(241, 237, 228, .3); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }
.feat-viz .row-line.on { stroke: var(--accent); stroke-dasharray: none; }
.feat-viz .node { fill: var(--ink); stroke: rgba(241, 237, 228, .55); stroke-width: 1.6; }
.feat-viz .node.hot { stroke: var(--accent); }
.feat-viz .node.on { fill: var(--accent); stroke: var(--accent); }
.feat-viz .dot { fill: var(--paper); }
.feat-viz .dot.on { fill: var(--accent); }

/* ---------- card thumbnails ---------- */
.thumb { width: 100%; height: 96px; display: block; margin-bottom: 4px; }
.thumb rect, .thumb path, .thumb circle { fill: none; stroke: rgba(241, 237, 228, .5); stroke-width: 1.4; }
.thumb .hot { stroke: var(--accent); stroke-dasharray: 4 3; fill: rgba(240, 80, 30, .22); }
.thumb .solid { fill: rgba(241, 237, 228, .2); }
.thumb .acc { fill: var(--accent); stroke: var(--accent); }

@media (max-width: 1000px) { .feat { grid-template-columns: 1fr; } }

/* ---------- shipped software cards ---------- */
.sw-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.sw-icon { width: 64px; height: 64px; border-radius: 14px; display: block; box-shadow: 0 0 0 1px var(--line-dk); }
.sw-points { list-style: none; margin: 2px 0 4px; padding: 0; display: grid; gap: 7px; }
.sw-points li { position: relative; padding-left: 18px; font-size: 14px; color: var(--muted-dk); }
.sw-points li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); }

.also-note { margin-top: 16px; font: 500 11px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted-dk); }
