/* Tall's showcase on h5bits.com/tall: Trykk's layout (~/Skynet/agents/trykk/h5bits/showcase),
   in Tall's own colours, taken from ui/src/style.rs (light theme): the accent fill #9CCB3B
   (ink on it is #121212), accent text #557A12, soft fill #F1F7E3, a typed number's blue #1F3FD8
   and a number from a table's green #1F7A3A. Light only, like Trykk's and like h5bits.com. */
:root {
  --paper: #ffffff;
  --ink: #121212;
  --muted: #5c5c5c;
  --rule: #e3e3e3;
  --accent: #9CCB3B;
  --accent-ink: #557A12;
  --accent-fill: #F1F7E3;
  --accent-sel: #E4EFCB;
  --accent-border: #CDE29E;
  --typed: #1F3FD8;
  --from-table: #1F7A3A;
  --grid: #e6e6e6;
  --head: #f6f6f4;
  color: var(--ink);
  background: var(--paper);
  font: 400 18px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
.idea img, .feat img, .pinboard img { width: 100%; } /* holds the layout even before an image exists */
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 40px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

section { padding: 64px 0 40px; border-top: 1px solid var(--rule); }
section:first-child { border-top: 0; padding-top: 18px; }
h2 { font-size: clamp(36px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -0.025em; font-weight: 800; margin: 0 0 14px; }
h3 { margin: 0; }
.section-lede { color: var(--muted); font-size: 20px; max-width: 36em; margin: 0 0 34px; }
.note { color: var(--muted); font-size: 15px; margin: 18px 0 0; max-width: 60em; }
.num { font-variant-numeric: tabular-nums; }

/* eyebrow with a cell cursor: a selected cell and its fill handle */
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.reg { width: 18px; height: 13px; border: 2px solid currentColor; border-radius: 2px; position: relative; flex: none; }
.reg::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 5px; height: 5px; background: currentColor; box-shadow: 0 0 0 1.5px var(--paper); }

/* a framed sheet */
.sheet { position: relative; margin: 0; }

/* 1 · demo: a small live sheet */
.demo-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: start; }
.book { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 50px rgba(18,18,18,.10); }
.book-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--rule); background: var(--head); font-size: 13px; color: var(--muted); }
.book-bar b { color: var(--ink); font-weight: 600; }
.book-bar .fx { margin-left: auto; font: 12.5px/1.3 "SF Mono", ui-monospace, Menlo, monospace; color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 3px 8px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid { width: 100%; border-collapse: collapse; font-size: 15px; table-layout: fixed; }
.grid th, .grid td { border: 1px solid var(--grid); height: 34px; padding: 0; }
.grid thead th { background: var(--head); color: var(--muted); font-size: 12px; font-weight: 500; height: 24px; }
.grid th.rn { width: 34px; background: var(--head); color: var(--muted); font-size: 12px; font-weight: 500; text-align: center; }
.grid col.a { width: 46%; } .grid col.b { width: 27%; }
.grid td.label { padding: 0 10px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid td.title { padding: 0 10px; font-weight: 700; font-size: 16px; }
.grid td.hint { padding: 0 10px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell { position: relative; display: block; width: 100%; height: 100%; border: 0; background: transparent; font: inherit; font-variant-numeric: tabular-nums; text-align: right; padding: 0 12px 0 8px; cursor: cell; color: var(--ink); white-space: nowrap; }
.cell.total { font-weight: 700; }
.cell[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent-ink); background: var(--accent-fill); z-index: 1; }
.cell.reads { background: var(--accent-sel); }
.grid td.mk { position: relative; }
.grid td.mk::after { content: ""; position: absolute; right: 1px; top: 5px; bottom: 5px; width: 3px; border-radius: 2px; z-index: 2; pointer-events: none; }
.grid td.typed::after { background: var(--typed); }
.grid td.table::after { background: var(--from-table); }
input.cell { cursor: text; outline: none; }
input.cell:focus { box-shadow: inset 0 0 0 2px var(--accent-ink); background: var(--accent-fill); }
.chart-row td { padding: 10px 12px 6px; height: auto; }
#chart { width: 100%; height: auto; display: block; overflow: visible; }
#chart rect { transition: y .45s cubic-bezier(.2,.7,.2,1), height .45s cubic-bezier(.2,.7,.2,1); }
.chart-text { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; fill: var(--muted); }
.chart-strong { fill: var(--ink); font-weight: 700; }

.trace { border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; background: #fff; }
.trace h3 { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.trace .what { font-size: 20px; font-weight: 700; line-height: 1.3; }
.trace .val { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.trace code.f { display: block; font-size: 13.5px; line-height: 1.5; padding: 8px 10px; white-space: pre-wrap; border-radius: 8px; }
.trace .src { font-size: 15.5px; color: var(--muted); margin: 10px 0 0; }
.tree { list-style: none; margin: 12px 0 0; padding: 0; font-size: 15px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--rule); }
.tree li { padding: 4px 0 4px 10px; position: relative; }
.tree .row { display: flex; gap: 10px; align-items: baseline; }
.tree .row .n { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.tree .tag { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.tag.typed { color: var(--typed); background: #EEF1FD; }
.tag.table { color: var(--from-table); background: #E8F3EB; }
.tag.calc { color: var(--accent-ink); background: var(--accent-fill); }
.key { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.key span { display: inline-flex; align-items: center; gap: 7px; }
.key i { width: 3px; height: 15px; border-radius: 2px; display: inline-block; }

/* 2 · tour */
.pinboard { position: relative; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #121212; font-weight: 800; font-size: 15px; display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(255,255,255,.9), 0 4px 12px rgba(18,18,18,.25); }
.legend { counter-reset: n; list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 36px; }
.legend li { counter-increment: n; position: relative; padding-left: 42px; color: var(--muted); font-size: 16.5px; line-height: 1.5; }
.legend li::before { content: counter(n); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #121212; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.legend b { color: var(--ink); }

/* the three big ideas: a full-width figure each, the argument beside it */
.idea { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 44px; align-items: center; margin: 0 0 64px; }
.idea:last-child { margin-bottom: 0; }
.idea:nth-child(even) { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.idea:nth-child(even) .idea-text { order: 2; }
.idea h3 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 12px; }
.idea p { color: var(--muted); font-size: 18px; margin: 0 0 12px; }
.idea .n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #121212; font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.idea img { border-radius: 12px; border: 1px solid var(--rule); box-shadow: 0 18px 50px rgba(18,18,18,.10); }

/* 3 · features */
.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 44px; }
.feat { margin: 0; }
.feat img { border-radius: 10px; border: 1px solid var(--rule); box-shadow: 0 10px 30px rgba(18,18,18,.07); }
.feat h3 { font-size: 21px; letter-spacing: -0.01em; margin: 16px 0 4px; }
.feat p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }

/* 4 · files */
.files-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 44px; margin-top: 26px; }
.files h3 { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; }
.files ul { margin: 0; padding: 0; list-style: none; }
.files li { padding: 12px 0; border-bottom: 1px solid var(--rule); color: var(--muted); }
.files li b { color: var(--ink); }
code { font: 14px/1 "SF Mono", ui-monospace, Menlo, monospace; background: #f3f3f3; padding: 2px 6px; border-radius: 5px; color: var(--ink); }

/* 5 · agents */
.agents { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.agents p { color: var(--muted); margin: 0 0 12px; max-width: 32em; }
.agents p.eyebrow { color: var(--accent-ink); }
.agents pre { margin: 0; background: #121212; color: #ececec; border-radius: 14px; padding: 24px 28px; font: 14.5px/1.75 "SF Mono", ui-monospace, Menlo, monospace; overflow-x: auto; box-shadow: 8px 8px 0 var(--accent); }
.agents pre b { color: #C4DE8E; font-weight: 600; }
.agents pre i { font-style: normal; color: #8a8a8a; }

/* 6 · facts */
.facts dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 36px; margin: 0; }
.facts dt { font-weight: 800; font-size: 19px; margin-bottom: 6px; }
.facts dd { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }

@media (max-width: 960px) {
  .demo-grid, .agents, .idea, .idea:nth-child(even) { grid-template-columns: 1fr; }
  .idea:nth-child(even) .idea-text { order: 0; }
  .legend { grid-template-columns: 1fr 1fr; }
  .facts dl { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .page { padding: 20px; }
  .feat-grid, .files-grid, .legend, .facts dl { grid-template-columns: 1fr; }
  .grid td.hint, .grid .hc { display: none; }
  .grid { font-size: 14px; table-layout: auto; }
  .grid col.a, .grid col.b { width: auto; }
  .pin { width: 22px; height: 22px; font-size: 12px; box-shadow: 0 0 0 3px rgba(255,255,255,.9); }
  .agents pre { font-size: 12px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #chart * { transition: none !important; }
}
