@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;700&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

/* tackOS components. Colours, families, spacing and radii come from tokens.css.
   The --fs-* scale mirrors the type styles; a page that scales with its container
   (the tour) redefines these seven variables and everything follows. */
:root {
  --fs-xs: .74rem; --fs-s: .88rem; --fs-b: 1rem; --fs-m: 1.15rem; --fs-h: 1.7rem; --fs-hero: 3.4rem;
}

/* ---------- base ---------- */
.tk { font-family: var(--font-body); color: var(--ink); line-height: 1.45; }
.tk *, .tk *::before, .tk *::after { box-sizing: border-box; }
.tk h1, .tk h2, .tk h3, .tk p, .tk ul, .tk ol, .tk pre { margin: 0; }
.tk a { color: var(--accent); }
.tk :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk code, .tk .mono { font-family: var(--font-mono); font-size: .92em; }
.tk h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h); line-height: 1.04; letter-spacing: -.02em; text-wrap: balance; }
.tk h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-m); line-height: 1.15; letter-spacing: -.01em; }
.lead { font-size: var(--fs-b); color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.note { font-size: var(--fs-s); color: var(--muted); }
.note strong { color: var(--ink); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad-y) var(--pad-x); display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.panel > * { min-width: 0; }
.cols { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.cols > * { min-width: 0; }
@media (min-width: 640px) { .cols { grid-template-columns: 1fr 1fr; } }

/* ---------- wordmark ---------- */
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-hero); letter-spacing: -.035em; line-height: .9; color: var(--ink); }
.wordmark span { color: var(--accent); }
.wordmark .logo { display: block; width: .85em; height: .85em; margin: 0 0 .08em -.1em; }
.wordmark.inline { display: inline-flex; align-items: center; gap: .12em; font-size: var(--fs-h); letter-spacing: -.02em; }
.wordmark.inline .logo { display: inline-block; margin: 0; width: 1em; height: 1em; }
.tagline { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-m); line-height: 1.25; max-width: 26ch; text-wrap: balance; }

/* ---------- eyebrow ---------- */
.meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--gap);
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; font-variant-numeric: tabular-nums;
}
.meta b { color: var(--accent); font-weight: 500; }

/* ---------- statement ---------- */
.statement { display: flex; flex-direction: column; justify-content: center; gap: calc(var(--gap) * .8); }
.statement .big { font-family: var(--font-display); font-weight: 700; font-size: calc(var(--fs-h) * 1.5); line-height: 1; letter-spacing: -.03em; text-wrap: balance; }
.statement .sub { font-size: var(--fs-m); color: var(--muted); max-width: 52ch; }

/* ---------- fragments and tally ---------- */
.frags { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35em; font-size: var(--fs-s); }
.frags li { padding-left: 1.1em; position: relative; }
.frags li::before { content: "–"; position: absolute; left: 0; color: var(--accent); }
.frags.inline { flex-direction: row; flex-wrap: wrap; gap: .3em 2em; color: var(--muted); }
.tally { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4em 1.6em; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-m); }
.tally .aside { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-s); color: var(--muted); }

/* ---------- chips ---------- */
.chip {
  display: inline-block; font-family: var(--font-mono); font-size: var(--fs-xs);
  padding: .1em .55em; border-radius: var(--r-pill); white-space: nowrap;
  background: var(--sunk); color: var(--muted);
}
.chip.cur { background: var(--l1-bg); color: var(--l1); }
.chip.old { background: var(--warn-bg); color: var(--warn); }
.chip.own-personal { background: var(--l2-bg); color: var(--l2); }
.chip.own-work { background: var(--l3-bg); color: var(--l3); }
.chip.own-client { background: var(--warn-bg); color: var(--warn); }
.chip.own-machine { background: var(--l4-bg); color: var(--l4); }
.chip .ico { color: currentColor; --ico-bg: none; width: 1.1em; height: 1.1em; margin-right: .3em; vertical-align: -.2em; }

/* ---------- icons: one symbol per concept, placed with <use>; a hue class tints a layer's icon ---------- */
.ico { width: 1.25em; height: 1.25em; vertical-align: -.25em; margin-right: .45em; flex: none; }
.ico.big { width: 2.2em; height: 2.2em; display: block; margin: 0 0 .35em; }
.ico, .ico-in { color: var(--hue, var(--accent)); --ico-bg: var(--hue-bg, var(--l1-bg)); }
.h1c { --hue: var(--l1); --hue-bg: var(--l1-bg); }
.h2c { --hue: var(--l2); --hue-bg: var(--l2-bg); }
.h3c { --hue: var(--l3); --hue-bg: var(--l3-bg); }
.h4c { --hue: var(--l4); --hue-bg: var(--l4-bg); }
.h5c { --hue: var(--l5); --hue-bg: var(--l5-bg); }

/* ---------- code, terminal, command line ---------- */
.code {
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.55;
  background: var(--sunk); border-radius: calc(var(--r) * .7);
  padding: calc(var(--gap) * .8) var(--gap);
  white-space: pre; overflow-x: auto; color: var(--ink); margin: 0;
}
.code .c { color: var(--muted); }
.code .k { color: var(--accent); }
.term { min-width: 0; }
.term-bar { display: flex; align-items: center; gap: .45em; padding: .5em .9em; border-radius: calc(var(--r) * .7) calc(var(--r) * .7) 0 0; background: var(--line); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }
.term-bar i { width: .75em; height: .75em; border-radius: 50%; background: var(--l5); }
.term-bar i:nth-child(1) { background: var(--warn); }
.term-bar i:nth-child(2) { background: var(--l3); }
.term-bar i:nth-child(3) { background: var(--l2); }
.term-bar span { margin-left: .6em; }
.term .code { border-radius: 0 0 calc(var(--r) * .7) calc(var(--r) * .7); }
.cmdline { display: flex; gap: calc(var(--gap) * .6); align-items: stretch; }
.cmdline .code { flex: 1; min-width: 0; font-size: var(--fs-xs); }
.copy-btn {
  font: inherit; font-size: var(--fs-xs); font-family: var(--font-mono);
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: calc(var(--r) * .7);
  padding: 0 1.1em; cursor: pointer;
}
.copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: var(--fs-s); }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: calc(var(--gap) * .42) calc(var(--gap) * .6); border-bottom: 1px solid var(--line); }
.table-wrap th { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table-wrap td code { font-size: .9em; overflow-wrap: anywhere; }
.table-wrap td .ico { width: 1em; height: 1em; vertical-align: -.15em; margin-right: .35em; }
.cmdtable td:first-child { white-space: nowrap; }
.cmdtable td:nth-child(2) { color: var(--muted); white-space: nowrap; }
.cmdtable td { padding-block: calc(var(--gap) * .34); }

/* ---------- cards, tiles, pillars, strips ---------- */
.card { display: flex; flex-direction: column; gap: calc(var(--gap) * .4); }
.card p, .card li { font-size: var(--fs-s); }
.card .frags + .code, .card .code + .frags { margin-top: calc(var(--gap) * .5); }
.tiles { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; flex-direction: column; gap: calc(var(--gap) * .3); padding-top: calc(var(--gap) * .6); border-top: 1px solid var(--line); min-width: 0; }
.tile p { font-size: var(--fs-s); color: var(--muted); }
.tile code { font-size: var(--fs-xs); color: var(--accent); overflow-wrap: anywhere; }
.tile h3 .ico.big { display: inline-block; width: 1.3em; height: 1.3em; margin: 0 .4em 0 0; vertical-align: -.22em; }
.pillars { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 640px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar { border-top: 3px solid var(--accent); padding-top: calc(var(--gap) * .7); display: flex; flex-direction: column; gap: calc(var(--gap) * .4); min-width: 0; }
.pillar h3 { font-size: calc(var(--fs-m) * 1.2); }
.pillar p { font-size: var(--fs-s); color: var(--muted); }
.strip { background: var(--sunk); border-radius: calc(var(--r) * .7); padding: calc(var(--gap) * .8) var(--gap); font-size: var(--fs-s); }
.strip strong { font-weight: 600; }
.loopstrip span { white-space: nowrap; margin-left: .9em; }
.loopstrip .ico { width: 1.3em; height: 1.3em; margin-right: .3em; }

/* ---------- file: one line per owner ---------- */
.file { border: 1px solid var(--line); border-radius: calc(var(--r) * .7); overflow: hidden; }
.fname { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); background: var(--sunk); padding: .55em var(--gap); }
.fline { display: flex; justify-content: space-between; align-items: center; gap: var(--gap); padding: .5em var(--gap); border-top: 1px dashed var(--line); font-family: var(--font-mono); font-size: var(--fs-s); }
.fline span:first-child { min-width: 0; overflow-wrap: anywhere; }
.fline.own-personal { box-shadow: inset 4px 0 var(--l2); }
.fline.own-work { box-shadow: inset 4px 0 var(--l3); }
.fline.own-client { box-shadow: inset 4px 0 var(--warn); }
.fline.own-machine { box-shadow: inset 4px 0 var(--l4); }

/* ---------- machines drawn as devices ---------- */
.machines { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 640px) { .machines { grid-template-columns: repeat(2, 1fr); } }
.machine { border: 1px solid var(--line); border-radius: calc(var(--r) * .7); padding: calc(var(--gap) * .8); display: flex; flex-direction: column; gap: calc(var(--gap) * .35); min-width: 0; }
.machine h3 { font-size: var(--fs-b); display: flex; justify-content: space-between; gap: .5em; }
.machine h3 span { font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }
.machine .agents { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); margin-top: -.3em; }
.machine.device { border: 2px solid var(--muted); border-bottom-width: .7em; border-radius: .7em .7em .35em .35em; position: relative; margin-bottom: 1em; }
.machine.device.laptop::after { content: ""; position: absolute; left: -3%; right: -3%; bottom: -1.15em; height: .45em; background: var(--muted); border-radius: 0 0 .6em .6em; }
.machine.device.desktop::after { content: ""; position: absolute; left: 38%; right: 38%; bottom: -1.15em; height: .45em; background: var(--muted); border-radius: .2em; box-shadow: 0 -.25em 0 -.05em var(--muted); }
.copyrow { display: flex; justify-content: space-between; align-items: center; gap: .6em; font-size: var(--fs-xs); border-top: 1px dashed var(--line); padding-top: calc(var(--gap) * .35); }
.copyrow code { flex: 1; min-width: 0; font-size: 1em; overflow-wrap: anywhere; }
.copyrow .ico { margin-right: 0; width: 1em; height: 1em; }

/* ---------- steps ---------- */
.steps { display: flex; flex-direction: column; gap: calc(var(--gap) * .55); padding-left: 1.3em; font-size: var(--fs-b); }
.steps .ico { width: 1.15em; height: 1.15em; vertical-align: -.22em; margin-right: .35em; }

/* ---------- drawings: inline SVG in the layer hues ---------- */
.viz-wrap { overflow-x: auto; }
.viz { display: block; width: 100%; height: auto; overflow: visible; }
.viz text { font-family: var(--font-mono); font-size: 14px; fill: var(--ink); }
.viz .t-d { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.viz .t-b { font-family: var(--font-body); font-size: 15px; }
.viz .t-s { font-size: 12.5px; letter-spacing: .02em; }
.viz .t-m { fill: var(--muted); }
.viz .t-acc { fill: var(--accent); }
.viz .t-warn { fill: var(--warn); }
.viz .box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.viz .accent-box { stroke: var(--accent); }
.viz .sunk { fill: var(--sunk); }
.viz .bezel { fill: var(--sunk); stroke: var(--muted); stroke-width: 2; }
.viz .ln { fill: none; stroke: var(--line); stroke-width: 1.5; }
.viz .flow { fill: none; stroke: var(--accent); stroke-width: 2; marker-end: url(#arrow); }
.viz .flow.merge { stroke-dasharray: 6 5; }
.viz .flow.orbit { stroke-dasharray: 7 5; }
.viz .lost { fill: none; stroke: var(--warn); stroke-width: 2; stroke-dasharray: 5 6; }
.viz .zone { fill: var(--warn-bg); fill-opacity: .5; stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 6 5; }
.viz .dot { fill: var(--accent); }
.viz .lane { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 2 6; }
.arrowhead { fill: var(--accent); }
.tie { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 4; }
.sheet-top { fill: var(--hue-bg); stroke: var(--hue); stroke-width: 1.5; }
.sheet-edge { fill: var(--hue); }
.sheet-label { fill: var(--hue); }
.sheet-tick { stroke: var(--hue); stroke-width: 1; stroke-dasharray: 2 3; }
.pin-shaft { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.pin-head { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
.slab.local .sheet-top { stroke-dasharray: 6 4; }

/* motion: dashes drift along flows; none of it when the reader asks for less motion */
@keyframes drift { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: no-preference) {
  .viz .flow.merge, .viz .flow.orbit, .viz .lost { animation: drift 2s linear infinite; }
}
