/* The landing page is a Tono project you scroll through: the app's top bar and Co-Tono around a page of tracks, each
   track one of the app's real views (gui/src). Greyscale chrome; colour means something: track colours on tracks,
   peach = the agent's edits, blue = you, yellow = Co-Tono and the loop, green = OK. */
@font-face {
  font-family: Firjar;
  src: url("fonts/firjar.ttf") format("truetype");
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-display: block;
}

:root {
  color-scheme: dark;
  --well: #0b0b0b;
  --bg: #141414;
  --strip: #181818;
  --panel: #1c1c1c;
  --slot: #262626;
  --raised: #2a2a2a;
  --line: #2c2c2c;
  --scale: #3a3a3a;
  --text: #e8e8e8;
  --soft: #a0a0a0;
  --muted: #8f8f8f;
  --accent: #e8d36a;
  --agent: #f4c3a6;
  --you: #a9c7f2;
  --ok: #6fbf7f;
  --kick: #e07a4f;
  --drums: #d8b04a;
  --bass: #5b9be0;
  --pad: #9b7ad8;
  --lead: #4cc3a0;
  --song: #8f8f8f;
  --sans: Inter, -apple-system, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --logo: Firjar, Inter, sans-serif;

  --top: 48px;
  --foot: 26px;
  --ruler: 44px;
  --side: 380px; /* Co-Tono */
  --sec: 146px;  /* a page section's track header */
  --head: 168px; /* an arrangement track header */
  --bar: 120px;  /* one bar of the page ruler */
  --play: 40vh;  /* where the page's playhead marker sits */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 8px); }
body { margin: 0; padding: var(--top) 0 var(--foot); background: var(--bg); color: var(--text); font: 400 12px/1.4 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.ok { background: var(--ok); }
.sp { flex: 1; }
.ib { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--soft); cursor: default; font-size: 16px; }
.ib:hover { background: var(--raised); color: var(--text); }
.ib.txt { width: auto; padding: 0 6px; font: 500 12px var(--sans); }
[class^="ph-"], [class*=" ph-"] { line-height: 1; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Top bar (the app's) ---------- */
.top { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 8px 0 14px; background: var(--panel); border-bottom: 1px solid var(--well); }
.brand { display: flex; align-items: center; gap: 4px; min-width: 0; height: 100%; }
.wm { display: block; font: 500 21px/1 var(--logo); letter-spacing: .02em; }
.brand .ph-caret-down { display: block; color: var(--muted); font-size: 11px; }
.proj { display: block; margin-left: 10px; color: var(--soft); font-size: 13px; line-height: 1; white-space: nowrap; }
.proj b { font-weight: 600; color: var(--text); }
.transport { display: flex; align-items: center; gap: 5px; margin: 0 auto; }
.tb { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #cfcfcf; cursor: pointer; }
.tb:hover { background: var(--raised); color: #fff; }
.tb .i-pause { display: none; }
#t-play.playing { background: #2f2f2f; color: #fff; }
#t-play.playing .i-play { display: none; }
#t-play.playing .i-pause { display: block; }
#t-loop.on { color: var(--accent); }
.lcd { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 32px; min-width: 58px; padding: 2px 9px; background: #0d0d0d; border: 1px solid var(--line); border-radius: 5px; }
.lcd b { font: 500 14px/1.1 var(--mono); color: #f0f0f0; font-variant-numeric: tabular-nums; }
.lcd i { font: 400 9px/1.2 var(--sans); font-style: normal; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.transport .lcd:first-of-type { min-width: 80px; }
.lcd.loop.on { border-color: #5a5122; }
.lcd.loop.on b { color: var(--accent); }
.lcd.loop:not(.on) b { color: var(--soft); }
.lcd.soon { border-color: #2e4a34; }
.lcd.soon b { color: var(--ok); font-size: 13px; }
.views { display: flex; gap: 2px; padding: 2px; background: #111; border: 1px solid var(--line); border-radius: 6px; }
.views a { color: var(--soft); font: 500 12.5px var(--sans); padding: 5px 10px; border-radius: 4px; }
.views a:hover { color: #fff; }
.views a.on { background: #333; color: #fff; }

/* ---------- The page ruler ---------- */
.ruler { position: absolute; z-index: 2; left: 0; top: var(--top); width: var(--ruler); background-color: var(--panel); border-right: 1px solid var(--well);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--bar) / 4 - 1px), #2a2a2a calc(var(--bar) / 4 - 1px) calc(var(--bar) / 4)); }
.ruler span { position: absolute; left: 0; right: 0; height: var(--bar); padding: 4px 0 0 7px; border-top: 1px solid #3a3a3a; font: 400 11px var(--mono); color: var(--muted); }
.ruler span.now { color: var(--accent); }
.rmark { position: fixed; z-index: 5; left: calc(var(--ruler) - 10px); top: calc(var(--top) + var(--play) - 5px); border-left: 9px solid #fff; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .5)); pointer-events: none; }

/* ---------- Page sections are tracks ---------- */
.page { margin: 0 var(--side) 0 var(--ruler); }
.trk { display: grid; grid-template-columns: var(--sec) minmax(0, 1fr); border-bottom: 1px solid var(--well); }
.th { position: relative; background: var(--strip); border-right: 1px solid var(--well); transition: background .3s; }
.th::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.th-in { position: sticky; top: calc(var(--top) + 10px); display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 16px; }
.th .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; }
.th .ms { display: flex; gap: 3px; }
.th .ms b { display: grid; place-items: center; width: 19px; height: 17px; border-radius: 3px; background: var(--raised); color: var(--soft); font: 600 10px var(--sans); }
.trk.now .th { background: #202020; }
.lane { min-width: 0; padding: 30px 28px 40px; background-image: linear-gradient(90deg, #1b1b1b 1px, transparent 1px); background-size: 12.5% 100%; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.trk.seen .reveal { opacity: 1; transform: none; }

/* A window: one of the app's dock panels, set into the page */
.win { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); box-shadow: 0 30px 70px -36px rgba(0, 0, 0, .9); }
.tabs { display: flex; align-items: stretch; height: 34px; flex: none; background: var(--panel); }
.tab { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 0; background: none; font: 400 13px var(--sans); color: var(--muted); white-space: nowrap; }
.tab.on { background: var(--bg); color: var(--text); }
.tab.dim { color: #6a6a6a; }
.tab i { font-size: 13px; color: var(--soft); }
.tab .n-acc { color: var(--agent); font: 500 12px var(--mono); }
.tab-r { margin-left: auto; align-self: center; padding: 0 12px; font: 400 11px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* intro */
#intro .lane { min-height: calc(100vh - var(--top) - var(--foot)); padding-top: 11vh; }
.typed { margin: 0; max-width: 12.5ch; font: 600 clamp(40px, 5.6vw, 84px)/1.02 var(--sans); letter-spacing: -.035em; min-height: 2.1em; }
.caret-l { display: inline-block; width: .07em; height: .8em; margin-left: .06em; background: var(--accent); vertical-align: -.05em; animation: blink 1s steps(1) infinite; }
.intro-more { max-width: 640px; opacity: 0; transform: translateY(8px); transition: opacity .8s ease, transform .8s ease; }
.intro-more.on { opacity: 1; transform: none; }
.sub { margin: 26px 0 0; font-size: clamp(15px, 1.35vw, 18px); line-height: 1.5; color: var(--soft); }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text); }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust i { font-size: 15px; color: var(--accent); }
.try { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 26px; }
.try > span { margin-right: 4px; font: 400 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.try .idea { width: auto; padding: 6px 10px; font-size: 12px; }
.try .idea i { font-size: 14px; }
.hint { display: flex; align-items: center; gap: 8px; margin: 34px 0 0; font: 400 12px var(--mono); color: var(--muted); }
.hint i { font-size: 14px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---------- Arrange (the app's) ---------- */
.arrange { position: relative; display: flex; flex-direction: column; height: 440px; }
.a-head { display: grid; grid-template-columns: var(--head) minmax(0, 1fr); height: 54px; flex: none; border-bottom: 1px solid var(--well); }
.a-tools { display: flex; align-items: center; gap: 1px; padding: 0 6px; background: var(--bg); border-right: 1px solid var(--well); }
.a-ruler { position: relative; background: var(--bg); cursor: pointer; }
.loopbar { position: absolute; top: 0; height: 4px; left: 0; right: 0; background: var(--accent); opacity: .9; transition: opacity .2s; }
.loopbar.off { opacity: 0; }
.nums { position: absolute; inset: 4px 0 20px; display: grid; grid-template-columns: repeat(8, 1fr); font: 400 12px/26px var(--mono); color: var(--soft); }
.nums span { padding-left: 6px; border-left: 1px solid var(--scale); }
.marks { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; font: 400 11.5px/20px var(--sans); color: var(--soft); }
.marks span { position: absolute; top: 0; padding-left: 6px; border-left: 2px solid var(--scale); animation: fadeIn .4s ease both; }
.a-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; background: var(--bg); }
.a-body::before, .v-rows::before { content: ""; position: absolute; left: var(--head); right: 0; top: 0; height: 100%; pointer-events: none;
  background-image: linear-gradient(90deg, #232323 1px, transparent 1px), linear-gradient(90deg, #1b1b1b 1px, transparent 1px); background-size: 12.5% 100%, 3.125% 100%; }
.empty { position: absolute; left: var(--head); right: 0; top: 34%; display: grid; justify-items: center; gap: 4px; color: var(--muted); transition: opacity .4s; }
.empty b { font-weight: 600; color: var(--soft); font-size: 13px; }
.empty.gone { opacity: 0; pointer-events: none; }
.ph { position: absolute; top: 0; bottom: 0; left: var(--head); width: 1px; background: #fff; pointer-events: none; z-index: 3; }

.row { position: relative; display: grid; grid-template-columns: var(--head) minmax(0, 1fr); height: 66px; border-bottom: 1px solid var(--well); animation: rowIn .45s cubic-bezier(.2, .8, .2, 1) both; }
.row.var { height: 40px; animation-duration: .35s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-8px); } }
.rh { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 5px; grid-template-rows: auto auto; column-gap: 8px; align-content: center; padding: 0 8px 0 16px; background: var(--strip); border-right: 1px solid var(--well); }
.rh::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tc); }
.rh .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh .db { font: 400 11.5px var(--mono); color: var(--muted); }
.rh .ms { grid-column: 2; grid-row: 1; display: flex; gap: 3px; align-self: end; }
.rh .ms button { width: 19px; height: 17px; padding: 0; border: 0; border-radius: 3px; background: var(--raised); color: var(--soft); font: 600 10px var(--sans); cursor: pointer; }
.rh .ms button.m.on { background: #b9864d; color: #111; }
.rh .ms button.s.on { background: var(--accent); color: #111; }
.rh .kn { grid-column: 2; grid-row: 2; display: flex; gap: 8px; justify-content: center; padding-top: 4px; }
.rh .kn svg { width: 17px; height: 17px; }
.rh .mt { grid-column: 3; grid-row: 1 / 3; align-self: stretch; margin: 10px 0; width: 3px; background: var(--well); border-radius: 2px; display: flex; align-items: flex-end; overflow: hidden; }
.rh .mt i { display: block; width: 100%; height: 100%; background: linear-gradient(to top, var(--ok) 70%, var(--accent)); transform-origin: bottom; transform: scaleY(0); }
.row.sel .rh { background: #202020; }
.row.var .rh { padding-left: 24px; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; cursor: pointer; }
.row.var .rh::before { opacity: .45; }
.row.var .key { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 4px; border: 1px solid var(--scale); font: 500 10.5px var(--mono); color: var(--soft); }
.row.var .vn { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--soft); }
.row.var .tag { font-size: 10.5px; color: var(--text); opacity: 0; }
.row.var.on .key { border-color: var(--text); color: var(--text); }
.row.var.on .vn { color: var(--text); font-weight: 500; }
.row.var.on .tag { opacity: 1; }
.row.muted .tl { opacity: .35; }
.tl { position: relative; transition: opacity .25s; }
.clip { position: absolute; top: 4px; bottom: 4px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--tc) 20%, #121212); animation: write .9s cubic-bezier(.6, 0, .2, 1) both; transition: box-shadow .4s, filter .6s; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.clip.gone { animation: cut .45s ease forwards; }
@keyframes cut { to { opacity: 0; transform: scaleY(.6); } }
.clip .cb { height: 15px; padding-left: 6px; background: var(--tc); color: #111; font: 600 10.5px/15px var(--sans); white-space: nowrap; overflow: hidden; }
.clip svg { display: block; width: 100%; height: calc(100% - 15px); }
.clip rect { fill: var(--tc); }
.clip rect.on { fill: #fff; }
.clip.touched { box-shadow: 0 0 0 1.5px var(--agent); }
.clip.dark { filter: brightness(.78) saturate(.9); }
.clip.hatch { background: repeating-linear-gradient(135deg, #1f2a38 0 6px, #18202b 6px 12px); outline: 1px dashed color-mix(in srgb, var(--bass) 70%, transparent); outline-offset: -1px; animation: none; }
.clip.hatch .cb { background: transparent; color: var(--text); text-align: center; padding: 0; height: 100%; line-height: 50px; font-weight: 500; }
.row.var .clip { background: #1a1f26; }
.row.var.on .clip { box-shadow: 0 0 0 1.5px #fff; background: color-mix(in srgb, var(--bass) 22%, #121212); }
.row.var .clip rect { opacity: .55; }
.row.var.on .clip rect { opacity: 1; }
.auto { position: absolute; inset: 19px 0 4px; width: 100%; height: calc(100% - 23px); pointer-events: none; }
.auto path { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Variants section: the same rows, playing on their own */
.vars { position: relative; }
.v-head .a-ruler { cursor: default; }
.v-rows { position: relative; }
.v-rows .row { animation: none; }
.v-rows .row.var .tag { display: none; }

/* ---------- History (the app's) ---------- */
.h-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--panel); border-top: 1px solid var(--well); border-bottom: 1px solid var(--well); }
.h-bar b { font-weight: 600; }
.h-note { margin-left: auto; color: var(--muted); }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: #111; border: 1px solid var(--line); border-radius: 6px; }
.seg button { border: 0; background: none; color: var(--soft); font: 500 11.5px var(--sans); padding: 3px 10px; border-radius: 4px; cursor: pointer; }
.seg button.on { background: #333; color: #fff; }
.seg button[data-f="agent"].on { color: var(--agent); }
.seg button[data-f="you"].on { color: var(--you); }
.hist { height: 330px; overflow-y: auto; margin: 0; padding: 4px 14px; list-style: none; }
.hist li { padding: 8px 0; border-bottom: 1px solid #232323; font-size: 12.5px; animation: fadeUp .35s ease both; }
.hist.f-agent li.you, .hist.f-you li.agent { display: none; }
.hist .hl { display: flex; gap: 8px; align-items: baseline; }
.hist .n { color: var(--muted); font: 400 11.5px var(--mono); min-width: 18px; }
.hist .who { font-weight: 500; }
.hist li.agent .who { color: var(--agent); }
.hist li.you .who { color: var(--you); }
.hist .cmd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist .d { padding-left: 26px; color: var(--soft); }
.hist .hist-empty { color: var(--muted); border: 0; padding: 14px 0; }

/* ---------- Co-Tono (the app's, gui/src/views/co-tono*.tsx) ---------- */
.cotono { position: fixed; z-index: 20; top: var(--top); bottom: var(--foot); right: 0; width: var(--side); display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--well); }
.ct-head { display: flex; align-items: center; gap: 8px; height: 38px; flex: none; padding: 0 6px 0 12px; background: var(--panel); border-bottom: 1px solid var(--well); }
.ct-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--accent); color: var(--well); font: 500 13px/1 var(--logo); letter-spacing: .02em; padding-top: 1px; flex: none; }
.ct-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ct-name b { font-weight: 600; font-size: 12.5px; }
.ct-name span { font-size: 10.5px; color: var(--muted); }
.tier { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border: 1px solid var(--accent); border-radius: 10px; font: 500 11px var(--sans); }
.tier i { font-size: 10px; }
.transcript { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.transcript > * { flex: none; animation: fadeUp .3s ease both; }
.start { display: flex; flex-direction: column; gap: 16px; padding: 12px 2px 0; }
.start h2 { margin: 0; font-size: 16px; font-weight: 600; }
.start .facts { font: 400 11px var(--mono); color: var(--muted); margin-top: 4px; }
.ideas { display: flex; flex-direction: column; gap: 6px; }
.idea { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--strip); color: #e0e0e0; font: 400 12px/1.35 var(--sans); text-align: left; cursor: pointer; }
.idea:hover { border-color: #4a4a4a; }
.idea i { font-size: 15px; color: var(--accent); }
.ideas-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 10px 8px; flex: none; }
.ideas-row:empty { display: none; }
.ideas-row .idea { width: auto; flex: none; padding: 5px 9px; white-space: nowrap; font-size: 11.5px; }
.ideas-row .idea i { font-size: 13px; }
.user { align-self: flex-end; max-width: 86%; white-space: pre-wrap; padding: 6px 10px; border: 1px solid #2b3442; border-radius: 10px 10px 3px 10px; background: #1e2329; line-height: 1.45; font-size: 12.5px; }
.reply { font-size: 12.5px; line-height: 1.55; color: #e0e0e0; }
.reply b { font-weight: 600; }
.reply.note { color: var(--soft); }
.caret::after { content: ""; display: inline-block; width: 6px; height: 13px; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.tools { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--strip); }
.tools-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; background: none; font: 400 11px var(--sans); color: var(--muted); text-align: left; cursor: pointer; }
.tools-h:hover { background: var(--raised); }
.tools-h i { font-size: 14px; transition: transform .2s; }
.tools.shut .tools-h i { transform: rotate(-90deg); }
.tools-h b { font-weight: 500; color: var(--text); }
.tools ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid #232323; }
.tools.shut ul { display: none; }
.tools li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-top: 1px solid #232323; font-size: 12px; animation: fadeIn .25s ease both; }
.tools li:first-child { border-top: 0; }
.tools li > i:first-child { font-size: 15px; color: #cfcfcf; }
.tools li.run > i:first-child { color: var(--accent); }
.tools li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools li .st { font-size: 14px; color: var(--ok); }
.tools li.run .st { color: var(--accent); animation: spin 1s linear infinite; }
.youch { display: flex; gap: 8px; padding: 6px 10px; border-radius: 6px; background: #151a21; color: #cfdbea; font-size: 11.5px; line-height: 1.45; }
.youch i { font-size: 14px; color: var(--you); margin-top: 1px; }
.youch b { color: var(--you); }
.receipt { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--strip); }
.receipt .rh3 { display: flex; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.receipt .rh3 b { font-weight: 600; }
.receipt .rh3 span { color: var(--muted); }
.receipt .rb { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.receipt .rt { display: flex; flex-direction: column; gap: 2px; }
.receipt .rt .w { padding-left: 14px; font: 400 11px var(--mono); color: #cfcfcf; }
.receipt .rf { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 11px; }
.receipt .rf .ok { color: var(--ok); }
.receipt .rf .soft { color: var(--soft); }
.composer { position: relative; display: flex; flex-direction: column; gap: 6px; flex: none; margin: 0 10px 10px; padding: 8px 8px 6px; border: 1px solid #333; border-radius: 8px; background: var(--strip); }
.composer:focus-within { border-color: var(--scale); }
.ctx { display: flex; flex-wrap: wrap; gap: 6px; }
.ctx:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border: 1px solid #4a4320; border-radius: 5px; background: var(--raised); color: var(--accent); font: 400 11px var(--mono); }
.composer textarea { min-height: 38px; max-height: 120px; resize: none; border: 0; padding: 2px; background: transparent; color: var(--text); font: 400 12.5px/1.45 var(--sans); outline: none; }
.composer textarea::placeholder { color: #8a8a8a; }
.c-row { display: flex; align-items: center; gap: 4px; }
.send { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--accent); color: #111; font-size: 15px; cursor: pointer; transition: opacity .2s; }
.send:disabled { opacity: .35; cursor: default; }

/* Co-Tono's cards: in its transcript, and set into the page */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--strip); }
.cards .card { padding: 14px 16px; gap: 12px; box-shadow: 0 24px 60px -34px rgba(0, 0, 0, .9); }
.card .ttl { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.card .ttl .muted { color: var(--muted); }
.card .src { font-size: 10px; color: var(--muted); }
.trk-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.trk-name::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); }
.old { color: var(--muted); }
.new { color: var(--accent); }
.knobs { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 8px 0; }
.knob { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 104px; }
.knob svg { width: 52px; height: 46px; }
.knob .nm { font-size: 11px; text-align: center; }
.knob .v { font: 400 10.5px var(--mono); }
.eq svg, .env svg { width: 100%; height: auto; display: block; }
.rh2 { display: flex; align-items: center; gap: 10px; }
.play-c { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: #111; cursor: pointer; font-size: 13px; }
.meta { display: flex; flex-direction: column; line-height: 1.3; }
.meta b { font-weight: 600; }
.meta span { font: 400 10.5px var(--mono); color: var(--muted); }
.wave { width: 100%; height: 40px; display: block; }
.wave rect { fill: #6a6a6a; }
.wave rect.p { fill: #bdbdbd; }
.ab .seg button { font-size: 11px; }
.tbl { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; font: 400 11px var(--mono); }
.tbl .h { color: var(--muted); }
.tbl .l { font-family: var(--sans); font-size: 11.5px; }
.vcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.vcard { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--strip); }
.vcard.on { border-color: var(--accent); }
.vcard .vh { display: flex; align-items: center; justify-content: space-between; font: 600 12px var(--mono); }
.vcard .play-c { width: 22px; height: 22px; font-size: 11px; background: #cfcfcf; }
.vcard.on .play-c { background: var(--accent); }
.vcard .vw { font-size: 11.5px; color: #cfcfcf; }
.btn { border: 1px solid #363636; background: var(--slot); color: var(--text); border-radius: 5px; font: 500 11px var(--sans); padding: 4px 10px; cursor: pointer; }
.btn:hover { border-color: #5a5a5a; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.btn:disabled { opacity: .5; cursor: default; }
.meters2 { display: grid; gap: 9px; }
.m2 .mh { display: flex; justify-content: space-between; font-size: 11.5px; }
.m2 .mh b { font: 400 11px var(--mono); color: var(--accent); }
.m2 .mh b.ok { color: var(--ok); }
.m2 .bar { position: relative; height: 4px; margin-top: 5px; background: var(--raised); border-radius: 2px; }
.m2 .tgt { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--ok) 45%, transparent); border-radius: 2px; }
.m2 .mk { position: absolute; top: -3px; width: 2px; height: 10px; background: var(--accent); transition: left .9s cubic-bezier(.2, .7, .2, 1); }
.checks { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 11.5px; }
.checks li { display: flex; align-items: center; gap: 7px; transition: opacity .4s, transform .4s; }
.checks li.hide { opacity: 0; transform: translateY(4px); }
.checks i { font-size: 14px; color: var(--ok); }
.checks li.warn i { color: var(--accent); }

/* views */
.screen-tabs { overflow-x: auto; scrollbar-width: none; }
.screen-tabs .tab { cursor: pointer; position: relative; }
.screen-tabs .tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform-origin: left; animation: fill var(--dur, 5s) linear both; }
.screen-tabs.paused .tab.on::after { animation: none; }
@keyframes fill { from { transform: scaleX(0); } }
.screen-frame { position: relative; aspect-ratio: 16 / 10; background: var(--well); }
.screen-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; opacity: 0; transition: opacity .6s ease; }
.screen-frame img.on { opacity: 1; }

/* master */
.master .lane { min-height: calc(100vh - var(--top) - var(--foot)); display: flex; align-items: center; justify-content: center; }
.out { display: grid; justify-items: center; gap: 24px; width: 100%; }
.big { font: 500 clamp(96px, 14vw, 210px)/.85 var(--logo); letter-spacing: .01em; }
.lr { display: grid; grid-template-columns: 14px 1fr; align-items: center; gap: 8px 10px; width: min(520px, 100%); font: 500 11px var(--mono); color: var(--muted); }
.lr div { height: 8px; background: var(--well); border-radius: 2px; overflow: hidden; }
.lr div i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--ok) 0 70%, var(--accent) 86%, #e0705a); }
.soon-l { margin: 0; font: 500 14px var(--mono); text-align: center; }
.soon-l i { font-style: normal; color: #5a5a5a; margin: 0 6px; }
.copy { color: var(--muted); }

/* ---------- Status bar (the app's) ---------- */
.status { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--foot); display: flex; align-items: center; gap: 14px; padding: 0 10px; background: var(--panel); border-top: 1px solid var(--well); font: 400 11px var(--mono); color: var(--muted); }
.status span { display: inline-flex; align-items: center; gap: 6px; }
.st-l { font: 500 12px var(--sans); color: var(--text); }
.status b { font-weight: 400; color: var(--text); }
.st-demo { color: #6a6a6a; }
.st-r { margin-left: auto; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1200px) {
  :root { --side: 330px; --sec: 104px; --head: 140px; }
  .rh .kn { display: none; }
  .rh .ms { grid-row: 2; grid-column: 1; justify-self: start; margin-top: 3px; }
  .rh .db { display: none; }
}
@media (max-width: 860px) {
  /* Co-Tono becomes a sheet at the bottom; page tracks get their header as a band. */
  :root { --side: 0px; --ruler: 26px; --foot: 0px; --sheet: 250px; --head: 96px; --play: 32vh; }
  body { padding-bottom: var(--sheet); }
  .status, .proj, .hide-m { display: none !important; }
  .top { gap: 8px; padding: 0 8px 0 12px; }
  .cotono { top: auto; left: 0; right: 0; width: auto; height: var(--sheet); border-left: 0; border-top: 1px solid var(--line); box-shadow: 0 -20px 40px -10px rgba(0, 0, 0, .7); }
  .cotono > .tabs { display: none; }
  .composer { margin: 0 8px 8px; padding: 6px 8px 4px; }
  .composer textarea { min-height: 22px; height: 26px; }
  .ctx, .c-row .ib { display: none; }
  .ruler span { padding-left: 3px; font-size: 9.5px; }
  .rmark { left: calc(var(--ruler) - 9px); }
  .trk { grid-template-columns: minmax(0, 1fr); }
  .th { border-right: 0; border-bottom: 1px solid var(--well); }
  .th::before { width: 100%; height: 3px; bottom: auto; }
  .th-in { position: static; padding: 10px 12px 8px; }
  .lane { padding: 16px 10px 24px; }
  #intro .lane { min-height: calc(100vh - var(--top) - var(--sheet) - 44px); padding-top: 5vh; }
  .master .lane { min-height: calc(100vh - var(--top) - var(--sheet) - 44px); }
  .arrange { height: 400px; }
  .row { height: 58px; }
  .row.var .rh { padding-left: 12px; }
  .row.var .tag, .tab-r, .h-note { display: none; }
  .hist { height: 280px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .hide-s { display: none !important; }
  .lcd.soon { min-width: 0; }
  .knob { width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Copy: eyebrow, section headings ---------- */
.eyebrow { margin: 0 0 18px; font: 500 12px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.sh { max-width: 720px; margin: 0 0 22px; }
.sh h2 { margin: 0; font: 600 clamp(24px, 2.6vw, 34px)/1.12 var(--sans); letter-spacing: -.02em; }
.sh p { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--soft); }
.sh .ask { width: auto; margin-top: 14px; padding: 6px 10px; font-size: 12px; }
.sh .ask i { font-size: 14px; }

/* ---------- Not a generator ---------- */
.vs { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; }
.vs-col { padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--strip); }
.vs-col.tono { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.vs-l { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.vs-col.tono .vs-l { color: var(--accent); }
.vs-art { position: relative; height: 64px; margin: 14px 0; border-radius: 6px; background: var(--well); overflow: hidden; }
.vs-art svg { position: absolute; inset: 6px 10px; width: calc(100% - 20px); height: calc(100% - 12px); }
.vs-art svg rect { fill: #4a4a4a; }
.vs-art > i { position: absolute; right: 8px; top: 8px; font-size: 16px; color: var(--muted); }
.vs-art.tracks { display: grid; gap: 3px; padding: 6px; background: var(--bg); }
.vs-art.tracks i { position: static; display: block; border-radius: 2px; background: linear-gradient(90deg, var(--tc) 0 70%, transparent 70%); background-size: 100% 100%; opacity: .85; animation: grow 3s ease-in-out infinite alternate; }
.vs-art.tracks i:nth-child(2) { animation-delay: -.6s; }
.vs-art.tracks i:nth-child(3) { animation-delay: -1.2s; }
.vs-art.tracks i:nth-child(4) { animation-delay: -1.8s; }
.vs-art.tracks i:nth-child(5) { animation-delay: -2.4s; }
@keyframes grow { from { background-size: 55% 100%; } to { background-size: 140% 100%; } }
.vs ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; }
.vs li { display: flex; gap: 8px; align-items: flex-start; }
.vs li i { font-size: 15px; margin-top: 1px; }
.vs-col.gen li { color: var(--soft); }
.vs-col.gen li i { color: var(--muted); }
.vs-col.tono li i { color: var(--ok); }

/* ---------- The knowledge layer, simplified ---------- */
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kv-stage { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 196px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--strip); transition: border-color .4s, box-shadow .4s; }
.kv-stage + .kv-stage::before { content: ""; position: absolute; left: -11px; top: 50%; width: 11px; height: 1px; background: var(--scale); }
.kv-stage.live { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.kv-l { display: flex; align-items: center; gap: 7px; font: 500 11px var(--mono); color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.kv-l b { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; background: var(--raised); color: var(--text); font-size: 10px; }
.kv-body { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.kv-body > * { animation: fadeUp .35s ease both; }
.kv-src { font: 400 10px var(--mono); color: var(--muted); }
.kv .user { align-self: flex-start; max-width: 100%; font-size: 13px; }
.kv-w { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 6px; background: var(--well); }
.kv-w b { font: 500 12px var(--mono); color: var(--accent); }
.kv-w span { font-size: 11.5px; color: #cfcfcf; line-height: 1.35; }
.kv-w em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.kv-r { display: flex; flex-direction: column; gap: 3px; padding: 7px 9px; border-left: 2px solid var(--you); border-radius: 0 6px 6px 0; background: var(--well); }
.kv-r small { display: flex; justify-content: space-between; font: 400 10px var(--mono); color: var(--muted); }
.kv-r small i { font-style: normal; color: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; }
.kv-r span { font-size: 11.5px; line-height: 1.35; }
.kv-a { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.kv-a i { font-size: 14px; color: var(--agent); }
.kv-c { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 7px; border-top: 1px solid var(--line); font: 400 11px var(--mono); color: var(--ok); }
.kv-rail { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; }
.ladder { display: flex; align-items: center; gap: 6px; }
.ladder b { padding: 2px 9px; border: 1px solid var(--line); border-radius: 10px; font: 500 11px var(--mono); color: var(--muted); transition: .4s; }
.ladder b.on { color: #111; background: var(--you); border-color: var(--you); }
.ladder i { width: 18px; height: 1px; background: var(--scale); }
.kv-t { flex: 1; min-width: 240px; font-size: 12px; color: var(--soft); }
.kv-t em { font-style: normal; font-family: var(--mono); color: var(--text); }

/* ---------- Questions ---------- */
.faq { max-width: 760px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px 2px; font-size: 15px; font-weight: 500; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 18px/1 var(--mono); color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 16px; max-width: 640px; font-size: 14px; line-height: 1.55; color: var(--soft); }
.faq code { font: 400 12.5px var(--mono); color: var(--text); }

/* ---------- Sign-up ---------- */
.notify { display: flex; gap: 6px; width: min(460px, 100%); }
.notify input[type="email"] { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #333; border-radius: 7px; background: var(--strip); color: var(--text); font: 400 13px var(--sans); outline: none; }
.notify input[type="email"]:focus { border-color: var(--scale); }
.notify button { padding: 9px 14px; border: 0; border-radius: 7px; background: var(--accent); color: #111; font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; }
.notify button:disabled { opacity: .5; cursor: default; }
.notify .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.n-msg { margin: -10px 0 0; font-size: 12px; color: var(--muted); }
.n-msg.ok { color: var(--ok); }
.n-msg.err { color: #ff8a7a; }

@media (max-width: 1200px) {
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-stage:nth-child(3)::before { display: none; }
}
@media (max-width: 860px) {
  .vs, .kv { grid-template-columns: minmax(0, 1fr); }
  .kv-stage { min-height: 0; }
  .kv-stage + .kv-stage::before { left: 50%; top: -11px; width: 1px; height: 11px; display: block !important; }
  .sh p { font-size: 14px; }
  .notify { flex-direction: column; }
}

/* ---------- The knowledge layer in 3D ---------- */
.kn3 { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px;
  background: radial-gradient(ellipse at 50% 45%, #1c1f26 0%, #121212 62%); box-shadow: 0 30px 70px -36px rgba(0, 0, 0, .9); }
#kn3d { display: block; width: 100%; height: 500px; }
.kn-ask { position: absolute; left: 16px; top: 16px; max-width: 60%; }
.kn-ask .user { font-size: 13.5px; }
.kn-ask small { display: block; margin-bottom: 6px; font: 500 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kn-steps { position: absolute; right: 16px; bottom: 78px; display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; }
.kn-steps li { display: flex; align-items: center; gap: 7px; justify-content: flex-end; font: 500 10.5px var(--mono); color: #6a6a6a; text-transform: uppercase; letter-spacing: .06em; transition: color .3s; }
.kn-steps b { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; background: var(--raised); color: var(--soft); font-size: 10px; transition: .3s; }
.kn-steps li.on { color: var(--text); }
.kn-steps li.on b { background: var(--accent); color: #111; }
.kn-out { position: absolute; left: 16px; top: 104px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line)); border-radius: 7px; background: rgba(12, 12, 12, .8); font: 400 12px var(--mono); color: var(--ok); opacity: 0; transform: translateY(6px); transition: .45s ease; }
.kn-out.on { opacity: 1; transform: none; }
.kn-out i { font-size: 15px; }
.kn3 .kv-rail { margin: 0 12px 12px; background: rgba(12, 12, 12, .55); }
@media (max-width: 860px) {
  #kn3d { height: 560px; }
  .kn-ask { max-width: 70%; }
  .kn-steps { display: none; }
  .kn-out { top: auto; bottom: 76px; left: 12px; right: 12px; font-size: 11px; }
}

.kn-note { margin: 12px 2px 0; font-size: 13px; color: var(--soft); }
.kn-note em { font-style: normal; font-family: var(--mono); color: var(--text); }

/* the layer names, on the left, each fading in as the request reaches its layer */
.kn-layers { position: absolute; left: 18px; top: 156px; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.kn-layers li { display: flex; align-items: center; gap: 9px; font: 500 11px var(--mono); color: var(--lc); text-transform: uppercase; letter-spacing: .1em;
  opacity: 0; transform: translateX(-8px); transition: opacity .6s ease, transform .6s ease; }
.kn-layers li.on { opacity: 1; transform: none; }
.kn-layers i { width: 7px; height: 7px; border-radius: 50%; background: var(--lc); box-shadow: 0 0 10px var(--lc); }
@media (max-width: 860px) {
  .kn-layers { top: 92px; left: auto; right: 14px; gap: 6px; }
  .kn-layers li { font-size: 9.5px; justify-content: flex-end; flex-direction: row-reverse; }
}
