/* Ante — site styles, second direction.
   A chalk-light page with ink type. The terminal window is the only dark object on it.
   Amber is the one Ante colour: the download button and the closing panel. */

:root {
  --chalk: #ECEEF1;
  --chalk-2: #F6F7F9;
  --ink: #0E1116;
  --ink-70: rgba(14, 17, 22, 0.72);
  --ink-50: rgba(14, 17, 22, 0.5);
  --ink-30: rgba(14, 17, 22, 0.3);
  --line: rgba(14, 17, 22, 0.12);
  --line-2: rgba(14, 17, 22, 0.22);
  --amber: #F5C56B;
  --amber-2: #FFD98A;
  --amber-ink: #8A5A00;
  --violet: #6B4DF5;
  --teal: #0FA7C4;
  --running: #2F7DF6;
  --waiting: #C58A0C;
  --idle: #8A93A2;
  --ok: #1C9C6B;
  --failed: #D9534F;

  /* the dark window keeps its own palette */
  --w-bg: #0B0D12;
  --w-side: #0E1015;
  --w-ice: #E0F7FF;
  --w-ice-70: rgba(224, 247, 255, 0.72);
  --w-ice-45: rgba(224, 247, 255, 0.45);
  --w-ice-25: rgba(224, 247, 255, 0.25);
  --w-hair: rgba(255, 255, 255, 0.08);
  --w-hair-2: rgba(255, 255, 255, 0.14);
  --w-amber: #F5C56B;
  --w-cyan: #5EE7FF;
  --w-violet: #B39CFF;
  --w-running: #4FB8FF;
  --w-ok: #34D399;

  --display: "Instrument Sans", "SF Pro Display", -apple-system, system-ui, sans-serif;
  --sans: "IBM Plex Sans", -apple-system, system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  --rail: 236px;
  --measure: 60ch;
  --pad: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; overflow-x: hidden;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: 0.9em; }
kbd {
  display: inline-block; min-width: 1.7em; padding: 0 0.45em;
  font-size: 0.78em; line-height: 1.7em; text-align: center;
  color: var(--ink-70); background: var(--chalk-2);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px;
}
kbd + kbd { margin-left: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }

/* ---------- shell: rail + content ---------- */

.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background: var(--chalk);
}
.rail-brand { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 0 6px 22px; }
.rail-brand img { grid-row: span 2; border-radius: 9px; }
.rail-brand-name { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.1; }
.rail-brand-ver { font-family: var(--mono); font-size: 11px; color: var(--ink-50); }
.rail-label { padding: 6px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-50); }
.rail-row {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px; border-radius: 7px;
  font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--ink-70);
}
.rail-row:hover { background: rgba(14, 17, 22, 0.05); color: var(--ink); }
.rail-row.is-active { background: var(--ink); color: var(--chalk); }
.rdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-30); flex: 0 0 auto; }
.rail-row.is-active .rdot { background: var(--amber); }
.rail-foot { margin-top: auto; display: grid; gap: 12px; }
.rail-live { display: grid; gap: 2px; padding: 12px 10px; border-top: 1px solid var(--line); font-size: 13px; }
.rail-live span:first-child { display: flex; align-items: center; gap: 8px; }
.rail-live b { font-family: var(--display); font-weight: 700; }
.rail-live-note { font-size: 12px; color: var(--ink-50); }
.rail .btn { width: 100%; justify-content: center; }

.content { min-width: 0; padding: 0 var(--pad) 0; overflow-x: clip; }
.hero, .stage, .section, .foot { max-width: 1080px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    min-width: 0; position: sticky; top: 0; height: auto; z-index: 20;
    flex-direction: row; align-items: center; gap: 10px;
    padding: 10px var(--pad);
    border-right: 0; border-bottom: 1px solid var(--line);
    background: rgba(236, 238, 241, 0.92); backdrop-filter: blur(10px);
  }
  .rail-brand { padding: 0; grid-template-columns: auto auto; }
  .rail-brand img { grid-row: auto; width: 26px; height: 26px; }
  .rail-brand-ver { display: none; }
  .rail-nav { display: flex; gap: 2px; overflow: auto; flex: 1; min-width: 0; scrollbar-width: none; }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-label { display: none; }
  .rail-row { height: 30px; padding: 0 9px; font-size: 13px; white-space: nowrap; }
  .rdot { display: none; }
  .rail-foot { margin: 0; }
  .rail-live { display: none; }
  .rail .btn { display: none; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid transparent;
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
  cursor: pointer; transition: transform 100ms ease, background 120ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-amber { color: var(--ink); background: var(--amber); border-color: rgba(14, 17, 22, 0.15); box-shadow: 0 1px 0 rgba(14, 17, 22, 0.15); }
.btn-amber:hover { background: var(--amber-2); }
.btn-ink { color: var(--chalk); background: var(--ink); }
.btn-ink:hover { background: #1C2029; }
.btn-lg { padding: 13px 20px; font-size: 16px; }

/* ---------- hero ---------- */

.hero { padding: clamp(40px, 7vw, 88px) 0 28px; max-width: 760px; }
h1 {
  font-size: clamp(38px, 5.2vw, 66px); line-height: 1.0; font-weight: 700;
  letter-spacing: -0.04em; max-width: 15ch;
}
.lead { margin: 24px 0 0; max-width: var(--measure); font-size: 18px; color: var(--ink-70); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }
.hero-meta { font-size: 14px; color: var(--ink-50); }
.hero-hint { margin: 20px 0 0; font-size: 14px; color: var(--ink-50); }

/* ---------- the window (dark) ---------- */

.stage { margin: 0 0 0; }
.window {
  position: relative; color: var(--w-ice); font-size: 12.5px;
  background: linear-gradient(180deg, #131722 0%, #0A0E18 100%);
  border: 1px solid rgba(14, 17, 22, 0.6); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 30px 60px -30px rgba(14, 17, 22, 0.55), 0 12px 24px -16px rgba(14, 17, 22, 0.4);
}
.window .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--idle); }
.window .dot-running { background: var(--w-running); box-shadow: 0 0 8px var(--w-running); }
.window .dot-waiting { background: var(--w-amber); box-shadow: 0 0 8px var(--w-amber); }
.window .dot-idle { background: #7E8798; }
.window kbd { color: var(--w-ice-70); background: rgba(255, 255, 255, 0.05); border-color: var(--w-hair-2); }

.titlebar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 38px; padding: 0 12px; border-bottom: 1px solid var(--w-hair); background: rgba(0, 0, 0, 0.25);
}
.lights { display: flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; }
.lights i:nth-child(1) { background: #FF5F57; }
.lights i:nth-child(2) { background: #FEBC2E; }
.lights i:nth-child(3) { background: #28C840; }
.tabs { display: flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, 0.3); border-radius: 8px; }
.tab {
  font: inherit; font-size: 12px; font-weight: 500; color: var(--w-ice-45);
  background: transparent; border: 0; border-radius: 6px; padding: 4px 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--w-ice-70); }
.tab.is-active { color: var(--w-ice); background: rgba(255, 255, 255, 0.08); }
.tab-badge {
  min-width: 16px; height: 16px; padding: 0 5px; border-radius: 8px;
  font-size: 10.5px; font-weight: 600; line-height: 16px; text-align: center; color: #1A1206; background: var(--w-amber);
}
.tab-badge[data-zero] { display: none; }
.titlebar-right { justify-self: end; }
.hotkey-pill { display: inline-flex; gap: 2px; opacity: 0.7; }

.body { display: grid; grid-template-columns: 220px 1fr; height: 560px; }
@media (max-width: 760px) { .body { grid-template-columns: 1fr; height: 580px; } .sidebar { display: none; } }

.sidebar { background: var(--w-side); border-right: 1px solid var(--w-hair); padding: 10px 8px; overflow: auto; }
.side-section + .side-section { margin-top: 14px; }
.side-label {
  display: flex; justify-content: space-between; align-items: center; padding: 4px 8px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--w-ice-45);
}
.side-plus { font: inherit; color: var(--w-ice-45); background: none; border: 0; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.side-row {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border-radius: 6px;
  font: inherit; color: var(--w-ice); background: none; border: 0; text-align: left; cursor: pointer;
}
.side-row:hover { background: rgba(255, 255, 255, 0.05); }
.side-row.is-active { background: rgba(255, 255, 255, 0.09); }
.side-glyph { color: var(--w-ice-45); font-size: 11px; }
.side-count { margin-left: auto; font-size: 11px; color: var(--w-amber); }
.side-count[data-zero] { color: var(--w-ice-25); }
.side-project-name { padding: 6px 8px 2px; font-weight: 600; font-size: 12.5px; }
.session-row { padding-left: 14px; }
.session-row .dot { flex: 0 0 7px; }
.session-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-row .agent { font-size: 10.5px; color: var(--w-ice-45); font-family: var(--mono); }

.panes { position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; display: none; }
.view.is-active { display: flex; flex-direction: column; }
.view-terminal { padding: 10px; }
.pane { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--w-bg); border-radius: 7px; border: 1px solid var(--w-hair); }
.pane-focused { border-color: rgba(245, 197, 107, 0.55); box-shadow: 0 0 0 1px rgba(245, 197, 107, 0.25); }
.pane-head {
  display: flex; justify-content: space-between; align-items: center; padding: 5px 10px;
  font-size: 11px; color: var(--w-ice-45); font-family: var(--mono); border-bottom: 1px solid var(--w-hair);
}
.term {
  flex: 1; margin: 0; padding: 12px 14px; overflow: auto; font-size: 12px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; color: #D7E6EE;
}
.term .p { color: var(--w-amber); }
.term .dim { color: var(--w-ice-45); }
.term .vio { color: var(--w-violet); }
.term .cy { color: var(--w-cyan); }
.term .ok { color: var(--w-ok); }
.term .cursor { display: inline-block; width: 7px; height: 14px; vertical-align: -2px; background: var(--w-amber); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 18px 12px; }
.board-head h3 { font-family: var(--sans); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.board-head p { margin: 2px 0 0; color: var(--w-ice-45); font-size: 12px; }
.board-back {
  font: inherit; font-size: 12px; color: var(--w-ice-70); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--w-hair-2); border-radius: 6px; padding: 5px 10px; cursor: pointer;
}
.board-back:hover { background: rgba(255, 255, 255, 0.09); }

.activity { padding: 0 18px 12px; }
.activity-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--w-ice-45); margin-bottom: 6px; }
.activity-strip { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 8px); gap: 2px; overflow: hidden; }
.activity-strip i { width: 8px; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, 0.05); transition: transform 120ms ease; }
.activity-strip i:hover { transform: scale(1.4); outline: 1px solid var(--w-ice-45); }
.activity-strip i[data-l="1"] { background: #0E4429; }
.activity-strip i[data-l="2"] { background: #006D32; }
.activity-strip i[data-l="3"] { background: #26A641; }
.activity-strip i[data-l="4"] { background: #39D353; }

.columns { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 18px 18px; min-height: 0; }
@media (max-width: 760px) { .columns { grid-template-columns: 1fr; overflow: auto; } }
.column { display: flex; flex-direction: column; min-height: 0; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--w-hair); border-radius: 9px; }
.column-head { display: flex; align-items: center; gap: 7px; padding: 9px 12px; font-size: 11.5px; font-weight: 600; color: var(--w-ice-70); border-bottom: 1px solid var(--w-hair); }
.column-count { margin-left: auto; font-weight: 500; color: var(--w-ice-45); }
.column-cards { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.column[data-status="waiting"] .column-head { color: var(--w-amber); }
.card {
  text-align: left; font: inherit; color: var(--w-ice); cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--w-hair); border-radius: 7px; padding: 9px 10px; display: grid; gap: 4px;
  transition: background 120ms ease, border-color 120ms ease;
}
.card:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--w-hair-2); }
.card-top { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--w-ice-45); font-family: var(--mono); }
.card-agent { color: var(--w-cyan); }
.card-agent[data-agent="codex"] { color: var(--w-violet); }
.card-agent[data-agent="shell"] { color: var(--w-ice-45); }
.card-title { font-size: 12.5px; font-weight: 500; line-height: 1.35; }
.card-state { font-size: 11px; color: var(--w-ice-45); }
.card[data-status="waiting"] .card-state { color: var(--w-amber); }
.card[data-status="working"] .card-state { color: var(--w-running); }
.card.is-moving { animation: cardIn 300ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes cardIn { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

.history-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.chip { font: inherit; font-size: 11px; color: var(--w-ice-45); background: transparent; border: 1px solid var(--w-hair); border-radius: 999px; padding: 3px 9px; cursor: pointer; }
.chip:hover { color: var(--w-ice-70); }
.chip.is-active { color: var(--w-ice); border-color: var(--w-hair-2); background: rgba(255, 255, 255, 0.07); }
.search { font: inherit; font-size: 12px; color: var(--w-ice); width: 220px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--w-hair-2); border-radius: 6px; padding: 5px 9px; }
.search::placeholder { color: var(--w-ice-25); }
.history-list { flex: 1; overflow: auto; padding: 0 10px 12px; }
.hrow {
  display: grid; grid-template-columns: 92px 1fr 72px 190px; align-items: center; gap: 12px;
  width: 100%; padding: 7px 8px; border-radius: 6px; font: inherit; color: var(--w-ice); background: none; border: 0; text-align: left; cursor: pointer;
}
.hrow:hover { background: rgba(255, 255, 255, 0.05); }
.hrow .h-agent { font-family: var(--mono); font-size: 11px; color: var(--w-cyan); }
.hrow .h-agent[data-agent="codex"] { color: var(--w-violet); }
.hrow .h-agent[data-agent="opencode"] { color: #7CF2C4; }
.hrow .h-agent[data-agent="ante"] { color: var(--w-ice-45); }
.hrow .h-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .h-title small { color: var(--w-ice-45); margin-left: 8px; }
.hrow .h-when { font-size: 11px; color: var(--w-ice-45); text-align: right; }
.hrow .h-resume { font-size: 11px; color: var(--w-cyan); font-family: var(--mono); opacity: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow:hover .h-resume { opacity: 1; }
.history-empty { padding: 24px; color: var(--w-ice-45); font-size: 12.5px; text-align: center; }
@media (max-width: 760px) { .hrow { grid-template-columns: 70px 1fr 72px; } .hrow .h-resume { display: none; } .history-tools { align-items: stretch; } .search { width: 100%; } }

.toast {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 8px; font-size: 12px; color: var(--w-ice);
  background: rgba(14, 16, 21, 0.92); border: 1px solid var(--w-hair-2); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7); animation: toastIn 200ms ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 6px); } }

/* ---------- sections ---------- */

.section { padding: clamp(64px, 9vw, 120px) 0 0; }
h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; max-width: 20ch; }
.section-lead { margin: 16px 0 0; max-width: var(--measure); font-size: 17px; color: var(--ink-70); }

/* states */
.states { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 36px; border-top: 2px solid var(--ink); }
.state { padding: 22px 24px 28px 0; border-right: 1px solid var(--line); }
.state + .state { padding-left: 24px; }
.state:last-child { border-right: 0; }
.state-name { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.state .dot { width: 9px; height: 9px; border-radius: 50%; }
.state .dot-running { background: var(--running); }
.state .dot-waiting { background: var(--waiting); }
.state .dot-idle { background: var(--idle); }
.state-count { margin: 6px 0 14px; font-size: 14px; color: var(--ink-50); }
.state-count b { font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--ink); margin-right: 4px; transition: color 200ms ease; }
.state-count b.is-changed { color: var(--waiting); }
.state p { margin: 0; color: var(--ink-70); font-size: 15px; }
@media (max-width: 760px) { .states { grid-template-columns: 1fr; } .state { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 0; } .state + .state { padding-left: 0; } }

/* day timeline */
.day { margin-top: 32px; }
.day-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-70); margin-bottom: 14px; }
.day-legend span { display: inline-flex; align-items: center; gap: 6px; }
.day-legend i { width: 10px; height: 10px; border-radius: 3px; }
.day-grid { position: relative; display: grid; grid-template-columns: 88px 1fr; row-gap: 8px; }
.day-row-label { font-family: var(--display); font-weight: 600; font-size: 13px; padding-top: 4px; }
.day-track { position: relative; height: 26px; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / 12)); }
.day-bar {
  position: absolute; top: 3px; height: 20px; border-radius: 4px; cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.day-bar:hover, .day-bar:focus-visible { transform: scaleY(1.15); filter: brightness(1.08); outline: 2px solid var(--ink); outline-offset: 1px; }
.day-bar[data-agent="claude"] { background: var(--teal); }
.day-bar[data-agent="codex"] { background: var(--violet); }
.day-bar[data-agent="opencode"] { background: #2FBF9A; }
.day-bar[data-agent="shell"] { background: var(--ink-30); }
.day-bar[data-waiting] { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0 4px, transparent 4px 8px); }
.day-axis { display: grid; grid-template-columns: 88px 1fr; margin-top: 6px; }
.day-axis-ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--ink-50); }
.day-caption { margin: 18px 0 0; font-size: 15px; color: var(--ink-70); max-width: var(--measure); min-height: 1.5em; }
.day-caption b { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .day-grid, .day-axis { grid-template-columns: 60px 1fr; } .day-row-label { font-size: 12px; } }

/* agents */
.agents { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.agents li {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2);
  font-family: var(--display); font-weight: 600; font-size: 15px; cursor: default;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.agents li:hover, .agents li.is-on { background: var(--ink); color: var(--chalk); border-color: var(--ink); }
.agents-cmd { margin: 18px 0 0; font-size: 14px; color: var(--ink-50); }
.agents-cmd code { color: var(--ink); background: var(--chalk-2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; }

/* defs */
.defs { margin: 36px 0 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; border-top: 2px solid var(--ink); }
.defs > div { border-bottom: 1px solid var(--line); }
.defs dt { padding: 20px 0 6px; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.015em; }
.defs dd { margin: 0; padding: 0 0 20px; color: var(--ink-70); font-size: 15px; max-width: 46ch; }
.defs code { background: var(--chalk-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 0.85em; }
@media (max-width: 760px) { .defs { grid-template-columns: 1fr; } }

/* keyboard */
.keyboard {
  margin: 32px 0 20px; padding: 12px; border-radius: 12px;
  background: var(--chalk-2); border: 1px solid var(--line);
  display: grid; gap: 6px; user-select: none;
  --u: clamp(22px, 3.4vw, 46px);
}
.kb-row { display: flex; gap: 6px; }
.key {
  height: var(--u); min-width: var(--u); flex: 0 0 auto; padding: 0 6px;
  display: flex; align-items: flex-end; justify-content: flex-start;
  border-radius: 6px; background: var(--chalk); border: 1px solid var(--line-2); border-bottom-width: 3px;
  font-family: var(--mono); font-size: clamp(8px, 1.1vw, 12px); color: var(--ink-70); padding-bottom: 4px;
  transition: background 90ms ease, color 90ms ease, transform 90ms ease, border-color 90ms ease;
}
.key[data-w="1.25"] { min-width: calc(var(--u) * 1.25 + 6px * 0.25); }
.key[data-w="1.5"] { min-width: calc(var(--u) * 1.5 + 6px * 0.5); }
.key[data-w="1.75"] { min-width: calc(var(--u) * 1.75 + 6px * 0.75); }
.key[data-w="2"] { min-width: calc(var(--u) * 2 + 6px); }
.key[data-w="2.25"] { min-width: calc(var(--u) * 2.25 + 6px * 1.25); }
.key[data-w="6"] { min-width: calc(var(--u) * 6 + 6px * 5); }
.keyboard .key.is-lit { background: var(--amber); color: var(--ink); border-color: var(--amber-ink); transform: translateY(1px); border-bottom-width: 2px; }
.key.is-mod { color: var(--ink-50); }
.key.is-arrow { justify-content: center; align-items: center; font-size: 11px; padding-bottom: 0; }
.kb-row.arrows { justify-content: flex-end; align-items: flex-end; }
.kb-arrows { display: grid; grid-template-columns: repeat(3, var(--u)); gap: 6px; }
.kb-arrows .key { height: calc(var(--u) / 2 - 3px); min-width: var(--u); }
.kb-arrows .key:nth-child(1) { grid-column: 2; grid-row: 1; }
.kb-arrows .key:nth-child(2) { grid-column: 1; grid-row: 2; }
.kb-arrows .key:nth-child(3) { grid-column: 2; grid-row: 2; }
.kb-arrows .key:nth-child(4) { grid-column: 3; grid-row: 2; }
@media (max-width: 760px) {
  .keyboard { --u: 17px; gap: 3px; padding: 8px; overflow-x: auto; }
  .kb-row { gap: 3px; }
  .key { padding: 0 3px 2px; border-radius: 4px; font-size: 7px; }
  .kb-arrows { gap: 3px; }
}

.shortcuts { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; border-top: 1px solid var(--line); }
.shortcut {
  display: grid; grid-template-columns: 170px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-70); cursor: default;
}
.shortcut:hover, .shortcut.is-hot { color: var(--ink); }
.shortcut.is-hot kbd { background: var(--amber); border-color: var(--amber-ink); color: var(--ink); }
.shortcut[data-live] { cursor: pointer; }
.sc-keys { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 14px; }
.sc-live { font-size: 11px; font-family: var(--display); font-weight: 700; color: var(--teal); border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; }
@media (max-width: 860px) { .shortcuts { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .shortcut { grid-template-columns: 1fr; gap: 4px; } .sc-live { justify-self: start; } }

/* download */
.download { margin: clamp(64px, 9vw, 120px) calc(-1 * var(--pad)) 0; background: var(--amber); color: var(--ink); }
.download-inner {
  display: grid; grid-template-columns: 150px 1fr; gap: 36px; align-items: start;
  max-width: calc(1080px + 2 * var(--pad)); padding: clamp(40px, 6vw, 72px) var(--pad);
}
.download-icon { filter: drop-shadow(0 18px 30px rgba(14, 17, 22, 0.35)); }
.download h2 { font-size: clamp(34px, 4.5vw, 56px); }
.download-lead { margin: 10px 0 22px; font-size: 17px; color: rgba(14, 17, 22, 0.75); max-width: var(--measure); }
.install { margin: 26px 0 0; padding-left: 20px; max-width: var(--measure); color: rgba(14, 17, 22, 0.8); }
.install li + li { margin-top: 8px; }
.checksum { margin: 22px 0 0; font-size: 12.5px; color: rgba(14, 17, 22, 0.6); word-break: break-all; }
@media (max-width: 640px) { .download-inner { grid-template-columns: 1fr; } .download-icon { width: 88px; height: 88px; } }

.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 26px 0 36px; font-size: 13.5px; color: var(--ink-50);
}

/* ---------- toolbar tools in the demo window ---------- */

.titlebar-right { display: flex; align-items: center; gap: 6px; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  font: inherit; font-family: var(--mono); font-size: 11px; color: var(--w-ice-70);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--w-hair); border-radius: 6px; cursor: pointer;
}
.tb-btn:hover, .tb-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.1); color: var(--w-ice); }
.tb-btn.is-running { color: var(--w-amber); }
.tb-ring { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; opacity: 0.8; }
.tb-check { font-size: 10px; }

.popover {
  position: absolute; top: 44px; right: 12px; z-index: 5; width: 260px;
  padding: 12px; border-radius: 10px; color: var(--w-ice);
  background: rgba(18, 21, 30, 0.97); border: 1px solid var(--w-hair-2);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9); backdrop-filter: blur(12px);
  animation: toastIn 160ms ease; font-size: 12px;
}
.pop-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 12.5px; margin-bottom: 8px; }
.pop-head-notes { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--w-hair); }
.pop-sub { font-weight: 400; font-size: 11px; color: var(--w-ice-45); }
.pop-btn {
  font: inherit; font-size: 11.5px; color: var(--w-ice); background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--w-hair-2); border-radius: 6px; padding: 5px 10px; cursor: pointer;
}
.pop-btn:hover { background: rgba(255, 255, 255, 0.12); }
.pop-btn-primary { color: #1A1206; background: var(--w-amber); border-color: transparent; font-weight: 600; }
.pop-btn-primary:hover { background: #FFD98A; }

.pomo-ring-wrap { position: relative; width: 120px; height: 120px; margin: 4px auto 10px; }
.pomo-ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.pomo-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 6; }
.pomo-arc { fill: none; stroke: var(--w-amber); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 263.9; stroke-dashoffset: 0; transition: stroke-dashoffset 900ms linear; }
#pomodoro[data-phase="break"] .pomo-arc, #pomodoro[data-phase="long"] .pomo-arc { stroke: var(--w-ok); }
.pomo-time { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.pomo-time b { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.pomo-time span { font-size: 10.5px; color: var(--w-ice-45); }
.pomo-actions { display: flex; gap: 6px; justify-content: center; }
.pomo-durations { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--w-hair); font-size: 10.5px; color: var(--w-ice-45); }
.pomo-durations b { color: var(--w-ice); font-family: var(--mono); font-weight: 500; margin-left: 3px; }

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 5px; }
.todo-item:hover { background: rgba(255, 255, 255, 0.05); }
.todo-item input[type="checkbox"] { appearance: none; width: 14px; height: 14px; margin: 0; border: 1px solid var(--w-ice-45); border-radius: 4px; cursor: pointer; flex: 0 0 auto; display: grid; place-content: center; }
.todo-item input[type="checkbox"]:checked { background: var(--w-amber); border-color: var(--w-amber); }
.todo-item input[type="checkbox"]:checked::after { content: "✓"; font-size: 10px; color: #1A1206; font-weight: 700; }
.todo-item span { flex: 1; }
.todo-list-done .todo-item span { color: var(--w-ice-45); text-decoration: line-through; }
.todo-item .todo-del { opacity: 0; font: inherit; color: var(--w-ice-45); background: none; border: 0; cursor: pointer; padding: 0 2px; }
.todo-item:hover .todo-del { opacity: 1; }
.todo-empty { padding: 6px 4px; color: var(--w-ice-45); }
.todo-add input {
  width: 100%; margin-top: 4px; font: inherit; font-size: 12px; color: var(--w-ice);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--w-hair); border-radius: 6px; padding: 6px 8px;
}
.todo-add input::placeholder, .notes::placeholder { color: var(--w-ice-25); }
.todo-done-toggle { margin-top: 6px; font: inherit; font-size: 11px; color: var(--w-ice-45); background: none; border: 0; cursor: pointer; padding: 2px 4px; }
.todo-done-toggle:hover { color: var(--w-ice-70); }
.notes {
  width: 100%; resize: none; font: inherit; font-size: 12px; line-height: 1.45; color: var(--w-ice);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--w-hair); border-radius: 6px; padding: 6px 8px;
}
.column-empty { padding: 18px 10px; text-align: center; font-size: 11.5px; color: var(--w-ice-45); }

/* Pi agent colours */
.card-agent[data-agent="pi"], .hrow .h-agent[data-agent="pi"] { color: #F7A8D8; }
.day-bar[data-agent="pi"] { background: #D96BB0; }

/* ---------- open source ---------- */

.btn-ghost { color: var(--ink); background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(14, 17, 22, 0.05); }
.source { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 32px; border-top: 2px solid var(--ink); padding-top: 24px; }
.source h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 12px; }
.source p { margin: 12px 0 0; font-size: 15px; color: var(--ink-70); max-width: 46ch; }
.code {
  margin: 0; padding: 14px 16px; border-radius: 8px; overflow-x: auto;
  background: var(--ink); color: #D7E6EE; font-size: 12.5px; line-height: 1.6;
}
.plain { margin: 0; padding-left: 18px; color: var(--ink-70); font-size: 15px; }
.plain li + li { margin-top: 6px; }
.plain code, .source p code { background: var(--chalk-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 0.85em; }
.source-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 28px; }
.source-link { font-size: 15px; color: var(--ink-70); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.source-link:hover { color: var(--ink); text-decoration-color: var(--ink); }
@media (max-width: 760px) { .source { grid-template-columns: 1fr; gap: 28px; } .popover { width: calc(100% - 24px); right: 12px; } }
