/* Kriya One landing page: "The canvas" section (#canvas). js/canvas.js adds the tab switching, the auto tour of the
   tabs, the column highlight and the request trace. Without JS every tab panel but the selected one is hidden by the
   `hidden` attribute and the rest is static and complete; with reduced motion nothing moves on its own. */

.cv { --cv-c: var(--k-amber); }

/* ================================================================ 1 · the canvas window: parallel, versioned tabs */
.cv-win { position: relative; border: 1px solid var(--ts-border); border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--ts-surface) 92%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ts-primary) 25%, transparent), 0 30px 80px -40px var(--k-glow); }
.cv-bar { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 14px; border-bottom: 1px solid var(--k-line);
  background: var(--ts-surface-sunken); font: 500 .75rem/1 var(--k-mono); color: var(--ts-text-muted); }
.cv-title { flex: 1; }
.cv-open b { color: var(--k-kicker); font-weight: 600; }

.cv-tabs { display: flex; gap: 4px; padding: 10px 10px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--k-line);
  background: color-mix(in srgb, var(--ts-surface-sunken) 55%, transparent); scroll-snap-type: x proximity; }
.cv-tabs::-webkit-scrollbar { display: none; }
.cv-tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px 0 9px;
  border: 1px solid var(--k-line); border-bottom: 0; border-radius: 10px 10px 0 0; cursor: pointer; scroll-snap-align: start;
  background: transparent; color: var(--ts-text-muted); font: 500 .78rem/1 var(--k-mono); white-space: nowrap;
  transition: color .2s, background .2s, border-color .2s, transform .25s var(--k-ease-spring); }
.cv-tab::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c); opacity: .55; transition: opacity .2s, box-shadow .2s; }
.cv-tab:hover { color: var(--ts-text); transform: translateY(-1px); }
.cv-tab[aria-selected="true"] { color: var(--ts-text); background: var(--ts-surface); border-color: color-mix(in srgb, var(--c) 55%, var(--ts-border));
  box-shadow: inset 0 2px 0 var(--c); }
.cv-tab[aria-selected="true"]::before { opacity: 1; box-shadow: 0 0 10px var(--c); }
.cv-tab:focus-visible { outline: 2px solid var(--k-amber); outline-offset: 2px; }
.cv-k { padding: 3px 5px; border-radius: 4px; font-size: .625rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--ts-surface-sunken); color: var(--ts-text-subtle); border: 1px solid var(--k-line); }
.cv-v { padding: 3px 6px; border-radius: 999px; font-size: .6875rem; color: var(--k-kicker);
  border: 1px solid color-mix(in srgb, var(--k-amber) 35%, transparent); }
.cv-live { color: var(--k-mint); border-color: color-mix(in srgb, var(--k-mint) 40%, transparent); }
.cv-live::before { content: "● "; }
.fx-m .cv-live::before { animation: cv-blink 1.4s steps(2, start) infinite; }
.cv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k-amber); box-shadow: 0 0 0 3px var(--k-glow-amber); }
.fx-m .cv-dot { animation: k-pulse 2s ease-out infinite; }
/* the auto tour's progress line under the selected tab */
.cv-tab .cv-prog { position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px; background: var(--c);
  transform-origin: left; transform: scaleX(0); opacity: .8; }
.cv-touring .cv-tab[aria-selected="true"] .cv-prog { animation: cv-prog var(--cv-dwell, 4.2s) linear both; }
@keyframes cv-prog { to { transform: scaleX(1); } }
@keyframes cv-blink { 50% { opacity: 0; } }

/* All panes share one grid cell, so the stage is always as tall as the tallest tab at this width: switching tabs (or
   the auto tour) never moves anything below. The panes not shown keep their space but are invisible, which also takes
   them out of the accessibility tree and the tab order, like [hidden] did. */
.cv-stage { position: relative; display: grid; padding: 22px; }
.cv-pane { grid-area: 1 / 1; align-content: start; display: grid; gap: 14px; outline: none; min-width: 0; }
.cv-pane[hidden] { display: grid; visibility: hidden; }
.cv-pane:focus-visible { outline: 2px solid var(--k-amber); outline-offset: 6px; border-radius: 8px; }
.fx-m .cv-pane.in { animation: cv-in .5s var(--k-ease-out) both; }
@keyframes cv-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.cv-cap { color: var(--ts-text-muted); font-size: .9375rem; line-height: 1.55; max-width: 60em; }
.cv-say { font: 500 .8125rem/1.4 var(--k-mono); color: var(--ts-text-muted); }
.cv-say .who { color: var(--k-kicker); margin-right: 4px; }
.cv-say .who.k { color: var(--k-indigo-hi); }
:root[data-theme="light"] .cv-say .who.k { color: #1C3EBA; }
.cv-hint { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: 0 16px 12px; font: 400 .6875rem/1 var(--k-mono); color: var(--ts-text-subtle); }
.cv-hint kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 4px;
  border: 1px solid var(--ts-border); background: var(--ts-surface-sunken); font: inherit; }
.cv-note { margin-top: 18px; max-width: 52em; color: var(--ts-text-muted); }

/* placeholder lines shared by the mock panes */
.cv .ln { display: block; height: 9px; border-radius: 5px; background: color-mix(in srgb, var(--ts-text) 14%, transparent); }
.cv .ln.h { height: 16px; width: 55%; background: color-mix(in srgb, var(--ts-text) 30%, transparent); }
.cv .w90 { width: 90%; } .cv .w80 { width: 80%; } .cv .w70 { width: 70%; } .cv .w60 { width: 60%; }

/* draft: a doc with Point & say pins and a version strip */
.cv-doc { position: relative; display: grid; gap: 10px; padding: 18px 18px 22px; max-width: 560px; border: 1px solid var(--k-line); border-radius: 12px;
  background: var(--ts-surface-raised); }
.cv-doc .ph { display: block; height: 96px; border-radius: 8px; background: linear-gradient(135deg, color-mix(in srgb, #B18CFF 45%, transparent), color-mix(in srgb, #6F8BFF 30%, transparent)); }
.cv-vers { display: flex; gap: 6px; margin-bottom: 4px; font: 500 .6875rem/1 var(--k-mono); }
.cv-vers span { padding: 4px 7px; border-radius: 999px; border: 1px solid var(--k-line); color: var(--ts-text-subtle); }
.cv-vers .on { color: #0B1433; background: var(--k-amber); border-color: var(--k-amber); }
.cv-vers .nx { border-style: dashed; }
.pin { position: absolute; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--k-pink); color: #fff; box-shadow: 0 6px 16px -4px rgba(255, 111, 168, .6); }
.pin::before { content: attr(data-n); transform: rotate(45deg); font: 700 .75rem/1 var(--k-mono); }
.pin i { position: absolute; left: 30px; top: -8px; transform: rotate(45deg); transform-origin: left; white-space: nowrap; font: italic 500 .75rem/1 var(--ts-font-sans);
  padding: 5px 8px; border-radius: 6px; background: var(--ts-surface); color: var(--ts-text); border: 1px solid var(--k-line); box-shadow: var(--ts-shadow-2); }
.pin.p1 { top: 46px; left: 58%; } .pin.p2 { top: 110px; left: 34%; }
.fx-m .cv-pane.in .pin { animation: cv-drop .55s var(--k-ease-spring) both; }
.fx-m .cv-pane.in .pin.p2 { animation-delay: .35s; }
@keyframes cv-drop { from { opacity: 0; translate: 0 -18px; } }

/* dashboard */
.cv-dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 620px; }
.kpi { display: grid; gap: 4px; padding: 12px; border-radius: 10px; border: 1px solid var(--k-line); background: var(--ts-surface-raised); }
.kpi b { font: 600 1.25rem/1 var(--k-mono); color: var(--ts-text); }
.kpi span { font: 400 .75rem/1 var(--k-mono); color: var(--ts-text-subtle); }
.kpi:nth-child(3) b { color: var(--k-amber); }
:root[data-theme="light"] .kpi:nth-child(3) b { color: #B86E00; }
.bars { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 8px; height: 130px; padding: 12px; border-radius: 10px; border: 1px solid var(--k-line);
  background: repeating-linear-gradient(0deg, transparent 0 25px, var(--k-line) 25px 26px), var(--ts-surface-raised); }
.bars i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #6F8BFF, color-mix(in srgb, #6F8BFF 40%, transparent));
  transform-origin: bottom; }
.bars i:last-child { background: linear-gradient(180deg, var(--k-amber), color-mix(in srgb, var(--k-amber) 40%, transparent)); }
.fx-m .cv-pane.in .bars i { animation: cv-grow .7s var(--k-ease-out) both; }
.bars i:nth-child(2) { animation-delay: .05s !important; } .bars i:nth-child(3) { animation-delay: .1s !important; }
.bars i:nth-child(4) { animation-delay: .15s !important; } .bars i:nth-child(5) { animation-delay: .2s !important; }
.bars i:nth-child(6) { animation-delay: .25s !important; } .bars i:nth-child(7) { animation-delay: .3s !important; }
@keyframes cv-grow { from { transform: scaleY(0); } }

/* phone preview */
.cv-phone { display: flex; }
.ph-frame { position: relative; display: grid; gap: 8px; align-content: start; width: 170px; padding: 26px 12px 14px; border-radius: 26px;
  border: 2px solid color-mix(in srgb, var(--ts-text) 35%, transparent); background: var(--ts-surface-raised); box-shadow: var(--ts-shadow-3); }
.ph-notch { position: absolute; top: 9px; left: 50%; width: 46px; height: 7px; margin-left: -23px; border-radius: 4px; background: color-mix(in srgb, var(--ts-text) 35%, transparent); }
.ph-img { display: block; aspect-ratio: 4 / 5; border-radius: 8px; background: linear-gradient(160deg, #FF6FA8, #F5A524 60%, #FFC15C); }
.ph-act { font: 500 .8125rem/1 var(--k-mono); color: var(--ts-text-muted); letter-spacing: .3em; }
.fx-m .cv-pane.in .ph-frame { animation: cv-rise .6s var(--k-ease-spring) both; }
@keyframes cv-rise { from { opacity: 0; transform: translateY(24px) rotate(-3deg); } }

/* live browser */
.cv-web { position: relative; max-width: 600px; border-radius: 12px; overflow: hidden; border: 1px solid var(--k-line); background: var(--ts-surface-raised); }
.cv-web .url { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--k-line);
  background: var(--ts-surface-sunken); font: 400 .75rem/1 var(--k-mono); color: var(--ts-text-muted); }
.cv-web .lock { color: var(--k-mint); font-size: .5rem; }
.frm { display: grid; gap: 10px; padding: 18px; }
.fld { position: relative; display: block; height: 30px; border-radius: 6px; border: 1px solid var(--ts-border); background: var(--ts-surface); overflow: hidden; }
.fld.s { width: 60%; }
.fld .typing { position: absolute; left: 10px; top: 10px; height: 9px; width: 58%; border-radius: 5px; background: color-mix(in srgb, var(--k-mint) 55%, transparent); transform-origin: left; }
.fx-m .cv-pane.in .typing { animation: cv-type 1.6s steps(14) .3s both; }
@keyframes cv-type { from { transform: scaleX(0); } }
.btn-s { justify-self: start; padding: 8px 14px; border-radius: 6px; font: 600 .75rem/1 var(--ts-font-sans); color: #0B1433; background: var(--k-amber);
  outline: 2px dashed color-mix(in srgb, var(--k-amber) 60%, transparent); outline-offset: 3px; }
.cur { position: absolute; left: 62%; top: 62%; width: 14px; height: 14px; border-left: 2px solid var(--ts-text); border-top: 2px solid var(--ts-text);
  transform: rotate(-10deg); }
.fx-m .cv-pane.in .cur { animation: cv-cur 2.4s var(--k-ease-out) both; }
@keyframes cv-cur { 0% { left: 20%; top: 30%; } 60% { left: 55%; top: 52%; } 100% { left: 62%; top: 62%; } }

/* order tracker app */
.cv-app { display: grid; gap: 12px; max-width: 640px; }
.app-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--k-line);
  background: var(--ts-surface-sunken); font: 500 .6875rem/1 var(--k-mono); color: var(--ts-text-muted); }
.chip.run { color: var(--k-mint); border-color: color-mix(in srgb, var(--k-mint) 40%, transparent); }
.chip.run::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fx-m .chip.run::before { animation: k-pulse 2s ease-out infinite; }
.app-tbl { width: 100%; border-collapse: collapse; font: 400 .8125rem/1.3 var(--k-mono); border: 1px solid var(--k-line); border-radius: 10px; overflow: hidden;
  background: var(--ts-surface-raised); }
.app-tbl th { text-align: left; font-weight: 500; font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ts-text-subtle);
  background: var(--ts-surface-sunken); }
.app-tbl th, .app-tbl td { padding: 8px 12px; border-bottom: 1px solid var(--k-line); }
.app-tbl tr:last-child td { border-bottom: 0; }
.st { padding: 2px 7px; border-radius: 999px; font-size: .6875rem; border: 1px solid var(--k-line); color: var(--ts-text-muted); }
.st.ok { color: var(--k-mint); border-color: color-mix(in srgb, var(--k-mint) 40%, transparent); }
.st.late { color: var(--ts-danger); border-color: color-mix(in srgb, var(--ts-danger) 45%, transparent); }
.fx-m .cv-pane.in .app-tbl tr.new td { animation: cv-row 1.2s var(--k-ease-out) .5s both; }
@keyframes cv-row { from { background: color-mix(in srgb, var(--k-amber) 30%, transparent); opacity: 0; } 40% { opacity: 1; } }
.cv-appr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 640px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--k-amber) 50%, var(--ts-border)); background: color-mix(in srgb, var(--k-amber) 9%, var(--ts-surface));
  font: 500 .8125rem/1.3 var(--ts-font-sans); }
.cv-appr .t { flex: 1 1 14em; }
.cv-appr .b { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--ts-border); font: 600 .75rem/1 var(--ts-font-sans); color: var(--ts-text); background: var(--ts-surface); }
.cv-appr .b.ok { background: var(--k-amber); border-color: var(--k-amber); color: #0B1433; }

/* ================================================================ 2 · what is under the tab: a layer matrix */
.cv-stack { margin-top: 64px; }
.cv-stack-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.cv-h3 { margin: 0; }
.cv-switch { margin: 0; }
/* a clean pill switch: no square/round markers before the labels; the input stays (visually hidden over its label)
   for the keyboard and screen readers, and the focus ring is on the label */
.cmp-switch.cv-switch label::before { content: none; }
.cmp-switch.cv-switch input { appearance: none; }

.cv-mx { display: grid; border: 1px solid var(--ts-border); border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--ts-bg) 85%, transparent); }
.mx-row { position: relative; display: grid; grid-template-columns: minmax(130px, .7fr) repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--k-line);
  transition: background .25s; }
.mx-row:first-child { border-top: 0; }
.mx-row:not(.mx-head):hover { background: color-mix(in srgb, var(--ts-primary) 6%, transparent); }
.mx-l, .mx-c { padding: 12px 14px; font-size: .875rem; line-height: 1.45; }
.mx-l { font: 500 .75rem/1.4 var(--k-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ts-text-subtle); align-self: center; }
.mx-c { position: relative; color: var(--ts-text-muted); border-left: 1px dashed var(--k-line); transition: opacity .35s, filter .35s, color .25s, background .25s; }
.mx-c[data-g]::before { content: attr(data-g) / ""; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px;
  border-radius: 5px; font: 700 .75rem/1 var(--k-mono); color: var(--ts-text-subtle); border: 1px solid var(--k-line); }
.mx-c[data-g="✓"]::before { color: var(--k-mint); border-color: color-mix(in srgb, var(--k-mint) 45%, transparent); }
.mx-c[data-g="◐"]::before { color: var(--k-kicker); border-color: color-mix(in srgb, var(--k-amber) 40%, transparent); }
.mx-c code { font-size: .8125em; }
.mx-head .mx-c { display: grid; gap: 2px; color: var(--ts-text); }
.mx-head .mx-c b { font: 700 .9375rem/1.2 var(--ts-font-sans); }
.mx-head .mx-c small { font: 400 .6875rem/1.3 var(--k-mono); color: var(--ts-text-subtle); }
.mx-head { background: var(--ts-surface-sunken); }
/* the focused column */
.cv-stack[data-focus="term"] .mx-c:not(.c-term), .cv-stack[data-focus="art"] .mx-c:not(.c-art), .cv-stack[data-focus="kriya"] .mx-c:not(.c-kriya) { opacity: .55; filter: saturate(.3); }
.cv-stack[data-focus="term"] .c-term, .cv-stack[data-focus="art"] .c-art, .cv-stack[data-focus="kriya"] .c-kriya {
  color: var(--ts-text); background: color-mix(in srgb, var(--ts-primary) 7%, transparent); }
.cv-stack[data-focus="kriya"] .mx-head .c-kriya b { color: var(--k-kicker); }
/* the trace: one step at a time lights up in the Kriya column */
.mx-row.tr .c-kriya { background: color-mix(in srgb, var(--k-amber) 16%, transparent); color: var(--ts-text);
  box-shadow: inset 3px 0 0 var(--k-amber); }
.fx-m .mx-row.tr .c-kriya::after { content: ""; position: absolute; left: -1px; top: 0; width: 3px; height: 100%; background: var(--k-amber); box-shadow: 0 0 12px var(--k-amber); }

.cv-trace { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.cv-log { flex: 1 1 26em; min-width: 0; margin: 0; padding: 12px 14px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--k-term-bg); color: var(--k-term-fg); font: 400 .8125rem/1.5 var(--k-mono); border: 1px solid var(--k-line); }
.cv-log .prompt { color: var(--k-amber); }
.cv-log .d { color: #9BB0FF; }
.cv-log .ok { color: #2FE3A0; }
.cv-stack > .fine { margin-top: 14px; }

/* ================================================================ 3 · the use case and the folder */
.cv-use { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; margin-top: 56px; align-items: stretch; }
.cv-story { display: grid; gap: 12px; align-content: start; }
.cv-story h3 { font-size: 1.375rem; }
.cv-story p { color: var(--ts-text-muted); }
.cv-story .who-tag { justify-self: start; }
.cv-story .who-go { justify-self: start; text-decoration: none; }
.cv-code { min-width: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--k-line); background: var(--k-term-bg); color: var(--k-term-fg); }
.cv-code-bar { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 0 14px; border-bottom: 1px solid rgba(136, 157, 231, .18);
  font: 500 .75rem/1 var(--k-mono); color: #A3A9B6; }
.cv-code pre { margin: 0; padding: 16px; overflow-x: auto; background: transparent; border: 0; }
.cv-code code { font: 400 .8125rem/1.6 var(--k-mono); color: inherit; background: none; padding: 0; }
.cv-code .c { color: #7B8191; }
.cv-code .k { color: #FFC15C; }

/* ================================================================ responsive */
@media (max-width: 960px) {
  .cv-use { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .cv-stage { padding: 16px; }
  .cv-hint { display: none; }
  .cv-dash { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi b { font-size: 1rem; }
  .pin i { display: none; }
  .cv-stack-top { flex-direction: column; align-items: stretch; }
  .cv-switch { align-self: flex-start; max-width: 100%; }
  .cv-lg { display: none; }
  .cv-code code { font-size: .75rem; }
  /* the matrix: one block per layer, the three cells stacked with their column name */
  .mx-head { display: none; }
  .mx-row { grid-template-columns: minmax(0, 1fr); padding: 6px 0 8px; }
  .mx-l { padding-bottom: 2px; color: var(--k-kicker); }
  .mx-c { border-left: 0; padding: 6px 14px 6px 14px; }
  .mx-c::after { display: block; margin-top: 2px; padding-left: 26px; font: 400 .6875rem/1.3 var(--k-mono); color: var(--ts-text-subtle); }
  .mx-c.c-term::after { content: "terminal agent"; }
  .mx-c.c-art::after { content: "claude chat artifact"; }
  .mx-c.c-kriya::after { content: "kriya canvas app"; }
  .fx-m .mx-row.tr .c-kriya::after { position: static; width: auto; height: auto; background: none; box-shadow: none; }
  .cv-stack[data-focus] .mx-c { opacity: 1; filter: none; }
  .cv-stack[data-focus="term"] .mx-c:not(.c-term), .cv-stack[data-focus="art"] .mx-c:not(.c-art), .cv-stack[data-focus="kriya"] .mx-c:not(.c-kriya) { display: none; }
}
@media (max-width: 480px) {
  .cv-tab { min-height: 44px; }
  .cv-bar .cv-title { display: none; }
  .cv-bar { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .cv-tab, .mx-c, .mx-row { transition: none; }
}
